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.
iot/labs/WebApp/wwwroot/pages/home.js

37 lines
1.3 KiB

function pages_home() {
return Vue.component('pages_home', function (resolve, reject) {
axios.get("/pages/home.html").then(function (response) {
resolve({
template: response.data,
data() {
return {
title:'首页',
url: apiHost + '/UserCenter/api/v1/user/getUserInfo'
};
},
mounted: function () {
$('title').text(this.title);
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;
}
},
})
});
});
}