提交 793cca87 编写于 作者: rushui.chen's avatar rushui.chen

20200119 一个手机号只能绑定一个微信

上级 64ab002a
流水线 #20973 已失败 于阶段
in 0 second
...@@ -28,6 +28,7 @@ public enum AccountExceptionEnum { ...@@ -28,6 +28,7 @@ public enum AccountExceptionEnum {
PICA_REGISTER_FAIL("216520", "注册失败"), PICA_REGISTER_FAIL("216520", "注册失败"),
PICA_WECHAT_CODE_ERROR("216521", "微信登录授权code不正确"), PICA_WECHAT_CODE_ERROR("216521", "微信登录授权code不正确"),
PICA_WECHAT_UNBIND("216522", "该微信号已绑定其他云鹊医账户,你可以使用微信登录云鹊医,在「设置」页解除绑定"), PICA_WECHAT_UNBIND("216522", "该微信号已绑定其他云鹊医账户,你可以使用微信登录云鹊医,在「设置」页解除绑定"),
PICA_WECHAT_BIND_OTHER("216524", "该手机号已绑定其他微信号,你可以使在「设置」页解除绑定"),
PICA_WECHAT_UNBIND_CURRENT("216523", "正在绑定中,请稍等"); PICA_WECHAT_UNBIND_CURRENT("216523", "正在绑定中,请稍等");
......
...@@ -22,6 +22,9 @@ public interface AccountUnionMapper { ...@@ -22,6 +22,9 @@ public interface AccountUnionMapper {
AccountUnionEntity selectByUnionId(String unionId); AccountUnionEntity selectByUnionId(String unionId);
AccountUnionEntity selectByAcctId(Integer acctId);
int deleteByPrimaryKey(Integer id); int deleteByPrimaryKey(Integer id);
int insert(AccountUnionEntity record); int insert(AccountUnionEntity record);
......
...@@ -314,6 +314,10 @@ public class LoginServiceImpl implements LoginService { ...@@ -314,6 +314,10 @@ public class LoginServiceImpl implements LoginService {
if (accountUnionResult!=null){ if (accountUnionResult!=null){
throw new PicaException(AccountExceptionEnum.PICA_WECHAT_UNBIND.getCode(), AccountExceptionEnum.PICA_WECHAT_UNBIND.getMessage()); throw new PicaException(AccountExceptionEnum.PICA_WECHAT_UNBIND.getCode(), AccountExceptionEnum.PICA_WECHAT_UNBIND.getMessage());
} }
AccountUnionEntity accountUnionEntityAccount = accountUnionMapper.selectByAcctId(acctId);
if (accountUnionEntityAccount!=null){
throw new PicaException(AccountExceptionEnum.PICA_WECHAT_BIND_OTHER.getCode(), AccountExceptionEnum.PICA_WECHAT_BIND_OTHER.getMessage());
}
AccountUnionEntity accountUnionEntity = new AccountUnionEntity(); AccountUnionEntity accountUnionEntity = new AccountUnionEntity();
accountUnionEntity.setAcctId(acctId.longValue()); accountUnionEntity.setAcctId(acctId.longValue());
accountUnionEntity.setDeleteFlag(1); accountUnionEntity.setDeleteFlag(1);
......
...@@ -181,7 +181,7 @@ public class AESUtil { ...@@ -181,7 +181,7 @@ public class AESUtil {
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String KEY="zJJ$c5md3$yuuhWW"; String KEY="zJJ$c5md3$yuuhWW";
System.out.println("-------------加密---------"); System.out.println("-------------加密---------");
String content = "13024112500"; String content = "15607241351";
System.out.println("加密前:" + content); System.out.println("加密前:" + content);
...@@ -190,7 +190,7 @@ public class AESUtil { ...@@ -190,7 +190,7 @@ public class AESUtil {
System.out.println("-------------解密---------"); System.out.println("-------------解密---------");
String encrypt = aesEncrypt(content, KEY); String encrypt = aesEncrypt(content, KEY);
System.out.println("加密后:" + encrypt); System.out.println("加密后:" + encrypt);
String decrypt = aesDecrypt("iacbQz0A5I/XHCZDVuJr3Q==", KEY); String decrypt = aesDecrypt(encrypt, KEY);
System.out.println("解密后:" + decrypt); System.out.println("解密后:" + decrypt);
//请求参数解密处理 //请求参数解密处理
......
...@@ -33,6 +33,15 @@ ...@@ -33,6 +33,15 @@
limit 1 limit 1
</select> </select>
<!--通过unionId查询用户信息-->
<select id="selectByAcctId" resultMap="BaseResultMap" parameterType="java.lang.Integer">
select
<include refid="Base_Column_List"/>
from account_union
where acct_id = #{acctId,jdbcType=INTEGER} and delete_flag = 1
limit 1
</select>
<!--解除绑定关系--> <!--解除绑定关系-->
<update id="updateUnbindByAcctId" parameterType="java.lang.Integer"> <update id="updateUnbindByAcctId" parameterType="java.lang.Integer">
update account_union update account_union
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册