update m2pool 新增注销账号功能
This commit is contained in:
@@ -10,6 +10,7 @@ import com.m2pool.common.security.annotation.InnerAuth;
|
||||
import com.m2pool.common.security.annotation.RequiresLogin;
|
||||
import com.m2pool.common.security.service.TokenService;
|
||||
import com.m2pool.common.security.utils.SecurityUtils;
|
||||
import com.m2pool.system.api.entity.CloseAccountVo;
|
||||
import com.m2pool.system.api.entity.SysRole;
|
||||
import com.m2pool.system.api.entity.SysUser;
|
||||
import com.m2pool.system.api.entity.SysUserLeveDate;
|
||||
@@ -200,8 +201,8 @@ public class SysProfileController extends BaseController
|
||||
@InnerAuth
|
||||
@ApiOperation(value = "谷歌安全验证码验证")
|
||||
@PostMapping("/checkGoogleCode")
|
||||
public R<Boolean> checkGoogleCode(@RequestBody Long code){
|
||||
return R.success(userService.checkGoogleCode(code));
|
||||
public R<Boolean> checkGoogleCode(@RequestBody CloseAccountVo closeAccountVo){
|
||||
return R.success(userService.checkGoogleCode(closeAccountVo.getGCode(),closeAccountVo.getUserEmail()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -238,7 +238,6 @@ public class SysUserController extends BaseController {
|
||||
return R.success(list);
|
||||
}
|
||||
|
||||
@RequiresLogin
|
||||
@PostMapping("/closeAccount")
|
||||
@ApiOperation(value = "用户注销")
|
||||
public AjaxResult closeAccount(@RequestBody SysUser sysUser){
|
||||
|
||||
@@ -166,7 +166,7 @@ public interface SysUserService {
|
||||
* @return 结果
|
||||
* @param code
|
||||
*/
|
||||
public boolean checkGoogleCode(Long code);
|
||||
public boolean checkGoogleCode(long code,String username);
|
||||
|
||||
/**
|
||||
* 查询所有聊天客服
|
||||
|
||||
@@ -381,9 +381,9 @@ public class SysUserServiceImpl implements SysUserService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkGoogleCode(Long code) {
|
||||
String username = SecurityUtils.getUsername();
|
||||
public boolean checkGoogleCode(long code,String username) {
|
||||
|
||||
System.out.println("用户名:"+username);
|
||||
//谷歌验证码校验
|
||||
GoogleInfo info = userMapper.getGoogleInfoByEmail(username);
|
||||
if(StringUtils.isNull(info)){
|
||||
@@ -403,7 +403,7 @@ public class SysUserServiceImpl implements SysUserService {
|
||||
if(GoogleAuthenticator.checkCode(info.getSecret(), code, System.currentTimeMillis())){
|
||||
return true;
|
||||
}else {
|
||||
throw new ServiceException("验证码错误");
|
||||
throw new ServiceException("谷歌验证码错误");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<update id="closeUser">
|
||||
update sys_user
|
||||
<set>
|
||||
<if test="delFlag != null">delFlag = #{delFlag},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where user_id = #{userId}
|
||||
|
||||
Reference in New Issue
Block a user