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

获取用户信息

parent 2c26227e
...@@ -29,6 +29,17 @@ export default { ...@@ -29,6 +29,17 @@ export default {
return { return {
msg: null, msg: null,
scrollPosition: 0, scrollPosition: 0,
userInfo: {
account: null,
token: "52d30e396dff44eca2f51f614e42a8c0",
userId: null,
residentId: null,
nickName: null,
realName: null,
gender: null,
headPortrait: null,
domain: window.location.href
}
} }
}, },
created() { created() {
...@@ -39,7 +50,8 @@ export default { ...@@ -39,7 +50,8 @@ export default {
if (path != '/') { if (path != '/') {
return; return;
} }
vm.getUserByToken(result, false); this.userInfo.token = result.token;
vm.getUserByToken(this.userInfo, false);
}; };
}, },
mounted() { mounted() {
...@@ -50,29 +62,18 @@ export default { ...@@ -50,29 +62,18 @@ export default {
}, },
methods: { methods: {
init() { init() {
let userInfo = { if (process.env.NODE_ENV == "dev") {
account: null, this.initUserInfo(this.userInfo, true);
token: "349eb2231a36490e88bbbe34eb330a5c", this.getUserByToken(this.userInfo, true);
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);
} else { } else {
let query = this.$route.query; let query = this.$route.query;
userInfo.token = query.token this.userInfo.token = query.token
this.initUserInfo(userInfo, true); this.initUserInfo(this.userInfo, true);
if (!userInfo.token) { if (!this.userInfo.token) {
this.msg = "获取用户信息异常!" this.msg = "获取用户信息异常!"
callMobile('init', {}); callMobile('init', {});
} else { } 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