You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.2 KiB
35 lines
1.2 KiB
function pages_home() {
|
|
return Vue.component(arguments.callee.toString(), function (resolve, reject) {
|
|
axios.get("/pages/home.html").then(function (response) {
|
|
resolve({
|
|
template: response.data,
|
|
data() {
|
|
return {
|
|
url: '/UserCenter/api/v1/user/getUserInfo'
|
|
};
|
|
},
|
|
mounted: function () {
|
|
weui.tab('#tab', { defaultIndex: 1 });
|
|
var url = this.url;
|
|
axios.get(url)
|
|
.then(function (response) {
|
|
store.commit('setUser', response.data);
|
|
})
|
|
.catch(function (error) {
|
|
})
|
|
},
|
|
methods: {
|
|
logout: function () {
|
|
store.commit('logout');
|
|
router.push('/login');
|
|
}
|
|
},
|
|
computed: {
|
|
user: function () {
|
|
return store.state.user;
|
|
}
|
|
},
|
|
})
|
|
});
|
|
});
|
|
} |