Commit 2dcc8b96 authored by 罗成兵's avatar 罗成兵

用户id获取

parent 7959da1d
......@@ -50,14 +50,14 @@ export default {
},
methods: {
init() {
if (process.env.NODE_ENV == "dev1") {
if (process.env.NODE_ENV == "dev") {
let userInfo = {
account: '18487125843',
token: 'd2e2c11475a04436bbcf1ca96a7ee056',
userId: null,
domain: window.location.href
};
this.initUserInfo(userInfo);
this.initUserInfo(userInfo,true);
this.getUserByToken(userInfo);
} else {
let query = this.$route.query;
......@@ -67,7 +67,7 @@ export default {
userId: null,
domain: window.location.href
};
this.initUserInfo(userInfo);
this.initUserInfo(userInfo,true);
if (!userInfo.token && !userInfo.account) {
this.msg = "用户信息获取失败!"
callMobile('init', {});
......@@ -88,7 +88,7 @@ export default {
getUserByToken(userInfo.token).then(res => {
if (res.code == 'SUCCESS') {
userInfo.userId = res.data
this.initUserInfo(userInfo)
this.initUserInfo(userInfo,false);
this.showMsg();
} else {
this.msg = "用户id获取失败!"
......@@ -98,8 +98,8 @@ export default {
handleBack() {
callMobile('goIndex', {});
},
initUserInfo(val) {
if (process.env.NODE_ENV == "dev") {
initUserInfo(val,isPc) {
if (isPc) {
window.sessionStorage.setItem('userInfo', JSON.stringify(val));
return;
}
......
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