|
@@ -9,6 +9,7 @@
|
|
|
url = encodeURIComponent(url);
|
|
|
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid="+config.appid+"&redirect_uri="+url+"&response_type=code&scope=snsapi_userinfo&state=123&connect_redirect=1#wechat_redirect"
|
|
|
window.location.href = url;
|
|
|
+ this.$cache.clear();
|
|
|
}
|
|
|
this.globalData.BASE_URL = config.BASE_URL;
|
|
|
},
|
|
@@ -17,7 +18,13 @@
|
|
|
let projectId = this.getQueryString('projectId');
|
|
|
this.globalData.projectId = projectId||'';
|
|
|
this.globalData.shareToken = shareToken||'';
|
|
|
- this.regist();
|
|
|
+ let cacheInfo = this.$cache.get('_user_regist');
|
|
|
+ if(cacheInfo){
|
|
|
+ this.globalData.userId = cacheInfo.userId;
|
|
|
+ this.globalData.token = cacheInfo.token;
|
|
|
+ }else{
|
|
|
+ this.regist();
|
|
|
+ }
|
|
|
document.body.style.setProperty("background-color",this.globalData.color4);
|
|
|
},
|
|
|
onHide: function() {
|
|
@@ -48,6 +55,10 @@
|
|
|
let token = ret.data.single.token;
|
|
|
this.globalData.token = token
|
|
|
}
|
|
|
+ this.$cache.set("_user_regist",{
|
|
|
+ userId:userId,
|
|
|
+ token:this.globalData.token
|
|
|
+ })
|
|
|
uni.$emit('request')
|
|
|
}
|
|
|
},
|