update 解决谷歌验证开启秘钥丢失问题

This commit is contained in:
yyb
2026-01-13 16:47:04 +08:00
parent d7556b94c7
commit c623837d52
2 changed files with 3 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package com.m2pool.lease.service.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
@@ -1045,11 +1046,7 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
// 根据邮箱查询是否已绑定
UserGoogleAuthInfo info = leaseUserMapper.getUserInfoByEmail(email);
//已绑定 正常走关闭谷歌验证流程
//校验gcode
boolean gResult = GoogleAuthenticator.checkCode(info.getSecret(), vo.getGCode(), System.currentTimeMillis());
if(!gResult){
if(!GoogleAuthenticator.checkCode(info.getSecret(), vo.getGCode(), System.currentTimeMillis())){
return Result.fail("谷歌验证码错误");
}
//校验邮箱验证码

View File

@@ -58,9 +58,8 @@
<update id="closeGoogleAuthenticator">
update lease_user
set
google_auth = '',
google_status = 2
where user_id = #{info.email}
where user_id = #{info.email} and del = false
</update>
<update id="openGoogleAuthenticator">