Commit 1feefd56 authored by 罗成兵's avatar 罗成兵

获取用户信息

parent 2c26227e
......@@ -29,6 +29,17 @@ export default {
return {
msg: null,
scrollPosition: 0,
userInfo: {
account: null,
token: "52d30e396dff44eca2f51f614e42a8c0",
userId: null,
residentId: null,
nickName: null,
realName: null,
gender: null,
headPortrait: null,
domain: window.location.href
}
}
},
created() {
......@@ -39,7 +50,8 @@ export default {
if (path != '/') {
return;
}
vm.getUserByToken(result, false);
this.userInfo.token = result.token;
vm.getUserByToken(this.userInfo, false);
};
},
mounted() {
......@@ -50,29 +62,18 @@ export default {
},
methods: {
init() {
let userInfo = {
account: null,
token: "349eb2231a36490e88bbbe34eb330a5c",
userId: null,
residentId: null,
nickName: null,
realName: null,
gender: null,
headPortrait: null,
domain: window.location.href
};
if (process.env.NODE_ENV == "dev1") {
this.initUserInfo(userInfo, true);
this.getUserByToken(userInfo, true);
if (process.env.NODE_ENV == "dev") {
this.initUserInfo(this.userInfo, true);
this.getUserByToken(this.userInfo, true);
} else {
let query = this.$route.query;
userInfo.token = query.token
this.initUserInfo(userInfo, true);
if (!userInfo.token) {
this.userInfo.token = query.token
this.initUserInfo(this.userInfo, true);
if (!this.userInfo.token) {
this.msg = "获取用户信息异常!"
callMobile('init', {});
} else {
this.getUserByToken(userInfo, true)
this.getUserByToken(this.userInfo, true)
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment