|
|
@@ -45,27 +45,75 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
|
|
|
|
name:"", |
|
|
|
path:'/pages/index/index', |
|
|
|
pathurl:'/pages/index/index', |
|
|
|
pathur2:'/pages/index/customer', |
|
|
|
pathur3:'/pages/center/prohibited/index', |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(opts) { |
|
|
|
this.name=opts.loginName ||''; |
|
|
|
let stat=opts.path||''; |
|
|
|
if(stat==1){ |
|
|
|
this.path=this.pathur3; |
|
|
|
}else if(stat==2){ |
|
|
|
this.path=this.pathur2; |
|
|
|
}else{ |
|
|
|
this.path=this.pathurl; |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow: function() { |
|
|
|
uni.request({ |
|
|
|
url: config.service.verify, |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
|
'Access-Token': uni.getStorageSync('weapp_session_login_data').token |
|
|
|
}, |
|
|
|
success: (data) => { |
|
|
|
if (data.data.code == 10000) { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
if(this.name==''){ |
|
|
|
uni.request({ |
|
|
|
url: config.service.verify, |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
|
'Access-Token': uni.getStorageSync('weapp_session_login_data').token |
|
|
|
}, |
|
|
|
success: (data) => { |
|
|
|
if (data.data.code == 10000) { |
|
|
|
uni.switchTab({ |
|
|
|
url: '/pages/index/index' |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
var userInfo=uni.getStorageSync('weapp_session_userInfo_data'); |
|
|
|
if(userInfo){ |
|
|
|
console.log(userInfo.loginName) |
|
|
|
if(this.name==userInfo.loginName){ |
|
|
|
uni.request({ |
|
|
|
url: config.service.verify, |
|
|
|
method: "GET", |
|
|
|
header: { |
|
|
|
'content-type': 'application/json', |
|
|
|
'Access-Token': uni.getStorageSync('weapp_session_login_data').token |
|
|
|
}, |
|
|
|
success: (data) => { |
|
|
|
if (data.data.code == 10000) { |
|
|
|
uni.switchTab({ |
|
|
|
url:this.path |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
console.log("不是本人") |
|
|
|
} |
|
|
|
}else{ |
|
|
|
console.log("没有用户信息") |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
onHide: function() {}, |
|
|
|
methods: { |
|
|
|
bindWxBLogin() { |
|
|
|
wx.navigateTo({ |
|
|
|