Commit 538943d1 authored by 黄媛媛's avatar 黄媛媛

token过期处理

parent 94373272
......@@ -531,10 +531,16 @@ export default {
this.comments = res.data.pageData;
// this.initRecommend();
}
},
(err)=>{
this.u = uni.getStorageSync("mall_UserInfo");
this.init();
this.initPage();
}
);
},
initRecommend() {
this.request2(
{
url: "/api/AppletGoods/GetAppletGoodsRecommendListForZY",
......
......@@ -107,7 +107,7 @@
</view>
</view>
<!-- 会员购买 -->
<view class="buyvip" v-if="words.isshowvipbuypic==0" @click="goUrl(words.vipbuyurl)">
<view class="buyvip" v-if="words.isshowvipbuypic==1" @click="goUrl(words.vipbuyurl)">
<image :src="words.vipbuyico" style="width: 100%;" mode='widthFix'></image>
</view>
</view>
......@@ -355,7 +355,7 @@
}
},
goUrl(url){
console.log(url)
if(url=='/pages/share-team/share-team' && this.sharedata.UserInfo.IsEnableFXGrade ==1){//判断我的团队是否粉象模式
uni.navigateTo({
url: url+'?IsEnableFXGrade='+ this.sharedata.UserInfo.IsEnableFXGrade
......
......@@ -46,13 +46,26 @@ export default {
msg: param.data,
token: this.GetOpenId().token
},
success: res => {
if (res.data.resultCode != 1) {
success: res => {
if(res.data.resultCode == 10000){
let u = uni.getStorageSync("mall_UserInfo");
// let u = {
// OpenId:'ow_7I5elwCN5OBcQVW0pkjXC_P7k',
// Name:"哈哈",
// Photo:"https://wx.qlogo.cn/mmopen/vi_32/zd9lKwHQVM5darszb5rfibhVp8yAiaT1YmHguxibzpjDz9MvbyHibpfBgBfibqhibChiaTDKTcicnZ2Y9k51PTibMdyMggA/132"
// }
this.getLogin_t(u)
typeof failed == "function" && failed(res.data);
}else if(res.data.resultCode != 1) {
uni.showToast({
title: res.data.message,
icon: "none",
});
} else {
});
}
else{
typeof success == "function" && success(res.data);
}
},
......@@ -64,11 +77,34 @@ export default {
typeof failed == "function" && failed(res.data);
}
});
}
}
// token失效再次登录接口
Vue.prototype.getLogin_t = function(obj) {
let pid = uni.getStorageSync("pid")?uni.getStorageSync("pid").pid:0;
this.request2(
{
url: '/api/AppletLogin/Login',
data: {
Source: 1,
OpenId: obj.OpenId,
Name: obj.Name,
Photo: obj.Photo,
Moblie: '',
SuperiorId: pid
}
},
res => {
if (res.resultCode == 1) {
uni.setStorageSync('mall_UserInfo', res.data);
uni.removeStorageSync('pid');
}
}
);
}
// 获取小程序APPID
Vue.prototype.GetMiniAppId = function() {
return 'wxacd9f8cc3480d29e'
// return 'wxcf0727a7c78b501e' //旅小友
}
//获取OpenId
Vue.prototype.GetOpenId = function() {
......
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