File tree Expand file tree Collapse file tree 4 files changed +45
-24
lines changed Expand file tree Collapse file tree 4 files changed +45
-24
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,8 @@ rm -rf ./api/obj
1010# cleanup CLIENT
1111rm -rf ./client/node_modules
1212rm -rf ./client/dist
13- rm ./client/index.html
1413
1514# cleanup DATABASE
16- rm -rf ./database/declarative-deploy
17- rm -rf ./database/imperative-deploy
1815rm -rf ./database/deploy/bin
1916rm -rf ./database/deploy/obj
2017
Original file line number Diff line number Diff line change 1+ const API = "/api/ef/todo" ;
2+
3+ export default API ;
Original file line number Diff line number Diff line change 3636</button >
3737</footer >
3838 </section >
39- <footer class =" info" >
40- <label v-if =" !userDetails" id =" login" >[<a href =" .auth/login/github" >login</a >]</label >
41- <label v-if =" userDetails" id =" logoff" >[<a href =" .auth/logout" >logoff {{userDetails}}</a >]</label >
42- <p >Double-click to edit a todo</p >
43- <p >Original <a href =" https://github.com/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-todomvc" >Vue.JS Sample</a > by <a href =" http://evanyou.me" >Evan You</a ></p >
44- <p >Part of <a href =" http://todomvc.com" >TodoMVC</a ></p >
45- </footer >
39+ <UserInfo />
4640</template >
4741
4842<script lang="js">
43+ import UserInfo from ' ./UserInfo.vue'
44+ import API from ' ../api.js'
4945
50- var API = " /api/ef/todo" ;
5146var HEADERS = { ' Accept' : ' application/json' , ' Content-Type' : ' application/json' };
5247
5348var filters = {
@@ -66,14 +61,17 @@ var filters = {
6661 }
6762};
6863
69- export default {
64+ export default {
65+ components: {
66+ UserInfo
67+ },
68+
7069 data () {
7170 return {
7271 todos: [],
7372 newTodo: " " ,
7473editedTodo: null ,
75- visibility: " all" ,
76- userDetails: null
74+ visibility: " all"
7775 };
7876 },
7977
@@ -84,16 +82,7 @@ export default {
8482 } else {
8583 window .location .hash = " " ;
8684 this .visibility = " all" ;
87- }
88-
89- fetch (' /.auth/me' )
90- .then (res => {
91- return res .json ()
92- })
93- .then (payload => {
94- const { clientPrincipal } = payload;
95- this .userDetails = clientPrincipal? .userDetails ;
96- });
85+ }
9786
9887 fetch (API , {
9988 headers: HEADERS ,
Original file line number Diff line number Diff line change 1+ <template >
2+ <footer class =" info" >
3+ <label v-if =" !userDetails" id =" login" >[<a href =" .auth/login/github" >login</a >]</label >
4+ <label v-if =" userDetails" id =" logoff" >[<a href =" .auth/logout" >logoff {{ userDetails }}</a >]</label >
5+ <p >Double-click to edit a todo</p >
6+ <p >Original <a href =" https://github.com/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-todomvc" >Vue.JS
7+ Sample</a > by <a href =" http://evanyou.me" >Evan You</a ></p >
8+ <p >Part of <a href =" http://todomvc.com" >TodoMVC</a ></p >
9+ </footer >
10+ </template >
11+
12+
13+ <script lang="js">
14+ export default {
15+ data () {
16+ return {
17+ userDetails: null
18+ };
19+ },
20+
21+ mounted () {
22+ fetch (' /.auth/me' )
23+ .then (res => {
24+ return res .json ()
25+ })
26+ .then (payload => {
27+ const { clientPrincipal } = payload;
28+ this .userDetails = clientPrincipal? .userDetails ;
29+ });
30+ }
31+ }
32+ < / script>
You can’t perform that action at this time.
0 commit comments