mirror of
http://git.coreshop.cn/jianweie/coreshoppro.git
synced 2026-02-05 05:09:49 +08:00
【优化】优化用户后台被禁用或者标注删除状态下,小程序前端禁止登录及提示的处理。
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<view>
|
<view>
|
||||||
<u-toast ref="uToast" />
|
<u-toast ref="uToast" />
|
||||||
<!-- #ifndef MP-WEIXIN -->
|
<!-- #ifndef MP-WEIXIN -->
|
||||||
<u-popup class="coreshop-bottom-popup-box" :show="showLogin" @close="hideModal" mode="bottom" :closeable="true">
|
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="bottom" :closeable="true">
|
||||||
<view class="radius coreshop-bg-white wrap">
|
<view class="radius coreshop-bg-white wrap">
|
||||||
<view v-if="!showCodeBox">
|
<view v-if="!showCodeBox">
|
||||||
<view class="wrap-content">
|
<view class="wrap-content">
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
</u-popup>
|
</u-popup>
|
||||||
<!-- #endif -->
|
<!-- #endif -->
|
||||||
<!-- #ifdef MP-WEIXIN -->
|
<!-- #ifdef MP-WEIXIN -->
|
||||||
<u-popup class="coreshop-bottom-popup-box" :show="showLogin" @close="hideModal" mode="center">
|
<u-popup class="coreshop-bottom-popup-box" :show="showLogin && sessionAuthIdTool" @close="hideModal" mode="center">
|
||||||
<view class="radius coreshop-bg-white">
|
<view class="radius coreshop-bg-white">
|
||||||
<view class="modal-box">
|
<view class="modal-box">
|
||||||
<view class="modal-box-detail-detail">
|
<view class="modal-box-detail-detail">
|
||||||
@@ -196,9 +196,11 @@
|
|||||||
// #ifdef MP-WEIXIN
|
// #ifdef MP-WEIXIN
|
||||||
var userInfo = this.$store.state.userInfo;
|
var userInfo = this.$store.state.userInfo;
|
||||||
//var token = this.$db.get('userToken');
|
//var token = this.$db.get('userToken');
|
||||||
if (Object.keys(userInfo).length != 0) {
|
//if (Object.keys(userInfo).length != 0) {
|
||||||
|
if (userInfo) {
|
||||||
//console.log("获取到store.state用户数据");
|
//console.log("获取到store.state用户数据");
|
||||||
} else {
|
} else {
|
||||||
|
_this.$store.commit('userInfo', "");
|
||||||
_this.doToken();
|
_this.doToken();
|
||||||
}
|
}
|
||||||
// #endif
|
// #endif
|
||||||
@@ -361,6 +363,8 @@
|
|||||||
_this.sessionAuthIdTool = res.otherData;
|
_this.sessionAuthIdTool = res.otherData;
|
||||||
//console.log("成功后获取sessionAuthIdTool:" + _this.sessionAuthIdTool);
|
//console.log("成功后获取sessionAuthIdTool:" + _this.sessionAuthIdTool);
|
||||||
} else {
|
} else {
|
||||||
|
_this.$u.toast(res.msg);
|
||||||
|
_this.$store.commit('userInfo', "");
|
||||||
_this.sessionAuthIdTool = res.otherData;
|
_this.sessionAuthIdTool = res.otherData;
|
||||||
//console.log("失败后获取sessionAuthIdTool:" + _this.sessionAuthIdTool);
|
//console.log("失败后获取sessionAuthIdTool:" + _this.sessionAuthIdTool);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -541,6 +541,9 @@
|
|||||||
this.isShopManager = res.data.isShopManager
|
this.isShopManager = res.data.isShopManager
|
||||||
this.storeId = res.data.storeId;
|
this.storeId = res.data.storeId;
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
this.hasLogin = false;
|
||||||
|
this.userInfo = null;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -596,7 +599,9 @@
|
|||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
hasLogin() {
|
hasLogin() {
|
||||||
this.getUserInfo();
|
if (this.hasLogin == true) {
|
||||||
|
this.getUserInfo();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//分享
|
//分享
|
||||||
|
|||||||
@@ -218,6 +218,20 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
var user = await _userServices.QueryByClauseAsync(p => p.id == userInfo.userId);
|
var user = await _userServices.QueryByClauseAsync(p => p.id == userInfo.userId);
|
||||||
if (user != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
|
if (user.status == (int)GlobalEnumVars.UserStatus.停用)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.isDelete == true)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
var claims = new List<Claim> {
|
var claims = new List<Claim> {
|
||||||
new Claim(ClaimTypes.Name, user.nickName),
|
new Claim(ClaimTypes.Name, user.nickName),
|
||||||
new Claim(JwtRegisteredClaimNames.Jti, user.id.ToString()),
|
new Claim(JwtRegisteredClaimNames.Jti, user.id.ToString()),
|
||||||
@@ -832,6 +846,21 @@ namespace CoreCms.Net.Web.WebApi.Controllers
|
|||||||
jm.code = 14007;
|
jm.code = 14007;
|
||||||
return jm;
|
return jm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (user.status == (int)GlobalEnumVars.UserStatus.停用)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (user.isDelete == true)
|
||||||
|
{
|
||||||
|
jm.status = false;
|
||||||
|
jm.msg = "您的账号已经被禁用。";
|
||||||
|
return jm;
|
||||||
|
}
|
||||||
|
|
||||||
//获取用户等级
|
//获取用户等级
|
||||||
var userGrade = await _userGradeServices.QueryByClauseAsync(p => p.id == user.grade);
|
var userGrade = await _userGradeServices.QueryByClauseAsync(p => p.id == user.grade);
|
||||||
//获取优惠券
|
//获取优惠券
|
||||||
|
|||||||
Reference in New Issue
Block a user