环境token

This commit is contained in:
zoujiandong
2024-05-07 10:37:12 +08:00
parent 5130ea5c7a
commit 28d49809e6
9 changed files with 71 additions and 12 deletions
+8 -2
View File
@@ -138,8 +138,14 @@ Page({
api.mobileLogin(params).then(response => {
app.globalData.isLogin=true;
console.log(response);
wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
const { envVersion } = wx.getAccountInfoSync().miniProgram;
if(envVersion=='release'){
wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
}else{
wx.setStorageSync('DEV_AUTH_TOKEN_'+usertype, response.data.token);
}
// wx.setStorageSync('AUTH_TOKEN_'+usertype, response.data.token);
wx.setStorageSync('user_id_'+usertype, response.data.user_id);
wx.setStorageSync('client_user_id_'+usertype, response.data.client_user_id);
app.globalData.config.userID = response.data.user_id;