From 9d058d279a7551354dcd4a2172185f3a3d63dc92 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期五, 01 三月 2019 12:29:55 +0800
Subject: [PATCH] 首页weex链接修改(按版本设置)
---
fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java | 107 ++++++++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 97 insertions(+), 10 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
index 49ecb5b..a4ac570 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/UserAccountController.java
@@ -15,6 +15,8 @@
import com.alipay.api.AlipayApiException;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.BindingAccount;
+import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
+import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode.ForbiddenUserIdentifyCodeTypeEnum;
import com.yeshi.fanli.entity.bus.user.LoginResult;
import com.yeshi.fanli.entity.bus.user.SMSHistory;
import com.yeshi.fanli.entity.bus.user.UserInfo;
@@ -44,6 +46,7 @@
import com.yeshi.fanli.service.inter.user.AccountMessageService;
import com.yeshi.fanli.service.inter.user.BindingAccountService;
import com.yeshi.fanli.service.inter.user.ExtractService;
+import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
import com.yeshi.fanli.service.inter.user.ShamUserService;
import com.yeshi.fanli.service.inter.user.SpreadUserImgService;
import com.yeshi.fanli.service.inter.user.TBPidService;
@@ -138,6 +141,9 @@
@Resource
private UserShareGoodsRecordService userShareGoodsRecordService;
+ @Resource
+ private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
+
private static final String PASSWORD_MAX_ERROR = "password_max_error";
private static final String EXTRACT_MIN_MONEY = "extract_min_money";
private static final String EXTRACT_MAX_MONEY = "extract_max_money";
@@ -167,15 +173,21 @@
if (loginType == 3 && !Constant.IS_TEST)// 楠岃瘉鐭俊楠岃瘉鐮�
{
- String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
- if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
- out.print(JsonUtil.loadFalseResult(90001, "楠岃瘉鐮侀敊璇�"));
- return;
+ // 鑻规灉搴旂敤鍟嗗簵涓婄嚎娴嬭瘯鍙风爜
+ if ("17316780233".equalsIgnoreCase(phone) && "258168".equalsIgnoreCase(vcode)) {
+ ;
+ } else {
+ String oldVcode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
+ if (StringUtil.isNullOrEmpty(oldVcode) || !oldVcode.equalsIgnoreCase(vcode)) {
+ out.print(JsonUtil.loadFalseResult(90001, "楠岃瘉鐮侀敊璇�"));
+ return;
+ }
}
redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
}
+ UserInfo tbUserInfo = new UserInfo();
if (!StringUtil.isNullOrEmpty(tbSession)) {
try {
tbSession = DESUtil.decode(tbSession.replace("\n", ""), StringUtil.getBase64String("YeShiFANLI889*+"),
@@ -187,12 +199,14 @@
tbOpenid = tbs.optString("openId");
tbNickName = tbs.optString("nick");
tbPortrait = tbs.optString("avatarUrl");
+ // 娣樺疂ID
+ tbUserInfo.setTaoBaoUid(tbs.optString("taobao_user_id"));
}
- UserInfo tbUserInfo = new UserInfo();
tbUserInfo.setOpenid(tbOpenid);
tbUserInfo.setTbName(tbNickName);
tbUserInfo.setTbPic(tbPortrait);
+
try {
LoginResult result = userAccountService.login(request, first, system.getAppid(), code, phone, tbUserInfo,
wxinstall, loginType);
@@ -412,15 +426,32 @@
String oldVCode = redisManager.getSMSVCode(phone, SMSHistory.TYPE_LOGIN);
- if (!vcode.equalsIgnoreCase(oldVCode)) {
- out.print(JsonUtil.loadFalseResult(90001, "楠岃瘉鐮侀敊璇�"));
- return;
+ if (Constant.IS_OUTNET) {
+ if (!vcode.equalsIgnoreCase(oldVCode)) {
+ out.print(JsonUtil.loadFalseResult(90001, "楠岃瘉鐮侀敊璇�"));
+ return;
+ }
+ redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
}
- redisManager.clearSMSFrequencyLimit(phone, SMSHistory.TYPE_LOGIN);
-
try {
userAccountService.bindPhone(uid, phone);
UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
+ // 鍒ゆ柇鐢佃瘽鍙风爜鏄惁宸茬粡灏佺
+ ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
+ .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.phone, phone);
+ if (ic != null && ic.getEffective() != null && ic.getEffective()) {
+ out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
+ // 灏佺鐢ㄦ埛
+ // 灏佺缁戝畾鐨勬甯哥敤鎴�
+ if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
+ UserInfo update = new UserInfo(uid);
+ update.setState(UserInfo.STATE_FORBIDDEN);
+ update.setStateDesc("缁戝畾琚皝绂佺殑鐢佃瘽鍙风爜琚皝绂�");
+ userInfoService.updateByPrimaryKeySelective(update);
+ }
+ return;
+ }
+
JSONObject data = new JSONObject();
data.put("user", UserUtil.filterForClientUser(user));
out.print(JsonUtil.loadTrueResult(data));
@@ -482,6 +513,8 @@
return;
}
+ String taoBaoUid = "";
+
if (!StringUtil.isNullOrEmpty(tbSession)) {
try {
tbSession = DESUtil.decode(tbSession.replace("\n", ""), StringUtil.getBase64String("YeShiFANLI889*+"),
@@ -493,11 +526,32 @@
tbOpenid = session.optString("openId");
tbNickName = session.optString("nick");
tbPortrait = session.optString("avatarUrl");
+ taoBaoUid = session.optString("taobao_user_id");
}
try {
userAccountService.bindTaoBao(uid, tbOpenid, tbNickName, tbPortrait);
UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
+
+ // 鍒ゆ柇taoBaoUid鏄惁宸茬粡灏佺
+ if (!StringUtil.isNullOrEmpty(taoBaoUid)) {
+ ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
+ .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid, taoBaoUid);
+ if (ic != null && ic.getEffective() != null && ic.getEffective()) {
+ out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER,
+ Constant.FORBIDDEN_USER_REASON_DESC));
+ // 灏佺鐢ㄦ埛
+ // 灏佺缁戝畾鐨勬甯哥敤鎴�
+ if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
+ UserInfo update = new UserInfo(uid);
+ update.setState(UserInfo.STATE_FORBIDDEN);
+ update.setStateDesc("缁戝畾琚皝绂佺殑娣樺疂鍙疯灏佺");
+ userInfoService.updateByPrimaryKeySelective(update);
+ }
+ return;
+ }
+ }
+
JSONObject data = new JSONObject();
data.put("user", UserUtil.filterForClientUser(user));
out.print(JsonUtil.loadTrueResult(data));
@@ -553,6 +607,22 @@
try {
userAccountService.changeWXBind(uid, code);
UserInfo user = userInfoService.getUserByIdWithMybatis(uid);
+ // 鍒ゆ柇taoBaoUid鏄惁宸茬粡灏佺
+ ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
+ .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId, user.getWxUnionId());
+ if (ic != null && ic.getEffective() != null && ic.getEffective()) {
+ out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
+ // 灏佺鐢ㄦ埛
+ // 灏佺缁戝畾鐨勬甯哥敤鎴�
+ if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
+ UserInfo update = new UserInfo(uid);
+ update.setState(UserInfo.STATE_FORBIDDEN);
+ update.setStateDesc("缁戝畾琚皝绂佺殑寰俊鍙疯灏佺");
+ userInfoService.updateByPrimaryKeySelective(update);
+ }
+ return;
+ }
+
JSONObject data = new JSONObject();
data.put("user", UserUtil.filterForClientUser(user));
out.print(JsonUtil.loadTrueResult(data));
@@ -816,6 +886,23 @@
return;
}
redisManager.cacheCommonString(key, "1", 120);
+
+ // 鏀粯瀹濈粦瀹�
+ ForbiddenUserIdentifyCode ic = forbiddenUserIdentifyCodeService
+ .listByTypeAndIdentifyCode(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount, account);
+ if (ic != null && ic.getEffective() != null && ic.getEffective()) {
+ out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
+ // 灏佺鐢ㄦ埛
+ // 灏佺缁戝畾鐨勬甯哥敤鎴�
+ if (user != null && user.getState() != null && user.getState() == UserInfo.STATE_NORMAL) {
+ UserInfo update = new UserInfo(uid);
+ update.setState(UserInfo.STATE_FORBIDDEN);
+ update.setStateDesc("缁戝畾琚皝绂佺殑鏀粯瀹濊灏佺");
+ userInfoService.updateByPrimaryKeySelective(update);
+ }
+ return;
+ }
+
// 鍙互灞曠ず缁欑敤鎴风湅鐨勯敊璇爜
String[] ALIPAY_CODES = new String[] { "SYSTEM_ERROR", "PERMIT_CHECK_PERM_LIMITED", "PERM_AML_NOT_REALNAME_REV",
"PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
--
Gitblit v1.8.0