This commit is contained in:
haomingming
2023-04-26 09:57:07 +08:00
parent 9e3cb69030
commit e7be139b04
8 changed files with 132 additions and 68 deletions
+19 -2
View File
@@ -4,6 +4,18 @@ Page({
data: {
loading: true
},
onLoad(option){
let from = option.from;
let usertype = wx.getStorageSync('usertype');
console.log("index onload: ", from, usertype)
if(from === "navbar"){
//切换身份
}else{
if(usertype == 2 || usertype == 3){
this.guideTo(usertype)
}
}
},
/**
* 生命周期函数--监听页面显示
*/
@@ -22,10 +34,16 @@ Page({
let url = e.currentTarget.dataset.url;
wx.setStorageSync('usertype', usertype);
wx.setStorageSync('next_url', url);
this.guideTo(usertype);
},
guideTo(usertype){
let url;
if(usertype == 2){
app.imInit();
url = "/Pages/yishi/index/index";
}else{
app.imLogout();
url = "/Pages/yaoshi/home/home";
}
let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
console.log(token);
@@ -37,5 +55,4 @@ Page({
app.go(app.globalData.login_url);
}
}
})
})