作者 xuqiang

提交

... ... @@ -173,7 +173,31 @@
if(res.data.code == 1){
uni.setStorageSync('token',res.data.data.userinfo.token)
that.$store.commit('login',res.data.data.userinfo)
if(that.backurl == '' || !that.backurl){
let userID = res.data.data.userinfo.id.toString()
let userSig = res.data.data.userinfo.user_sign
let userInfo = {
user: res.data.data.userinfo.nickname,
userId:res.data.data.userinfo.id,
img:res.data.data.userinfo.avatar,
userSig:res.data.data.userinfo.user_sign
}
//登录腾讯IM及时通讯
let promise = that.tim.login({
userID: userID,
userSig: userSig
});
promise.then((res) => {
//登录成功后 更新登录状态
that.$store.commit("toggleIsLogin", true);
//自己平台的用户基础信息
uni.setStorageSync('userInfo', JSON.stringify(userInfo))
//tim 返回的用户信息
uni.setStorageSync('userTIMInfo', JSON.stringify(res.data))
}).catch((err) => {
// 登录失败的相关信息
});
that.$href('index',2)
/* if(that.backurl == '' || !that.backurl){
that.$href('index',2)
}else{
if(that.backurl==1){
... ... @@ -185,7 +209,7 @@
url:that.backurl
})
}
}
} */
}else{
uni.showToast({
title:res.data.msg,
... ...