优化代码

This commit is contained in:
wuxw 2023-10-15 11:40:32 +08:00
parent eda87ff650
commit 3725ca0005
2 changed files with 8 additions and 1 deletions

View File

@ -126,12 +126,16 @@
} }
}, },
_doRegister: function(e) { _doRegister: function(e) {
let _communityId = un.getStorageSync("DEFAULT_COMMUNITY_ID")
if(!_communityId){
_communityId = conf.DEFAULT_COMMUNITY_ID;
}
let obj = { let obj = {
"link": this.link, "link": this.link,
"msgCode": this.msgCode, "msgCode": this.msgCode,
"password": this.password, "password": this.password,
"openId": uni.getStorageSync(constant.mapping.CURRENT_OPEN_ID), "openId": uni.getStorageSync(constant.mapping.CURRENT_OPEN_ID),
"defaultCommunityId": conf.DEFAULT_COMMUNITY_ID "defaultCommunityId": _communityId
} }
if(!this.readme){ if(!this.readme){
wx.showToast({ wx.showToast({

View File

@ -197,6 +197,9 @@
this.couponCount = chargeCoupons.length; this.couponCount = chargeCoupons.length;
}, },
_toLogin:function(){ _toLogin:function(){
if(this.communityId){
uni.setStorageSync("DEFAULT_COMMUNITY_ID",this.communityId);
}
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/login' url: '/pages/login/login'
}) })