From 8d3af50dc891df38e694178613503fb589ede6af Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Mon, 30 Nov 2020 11:27:44 +0800 Subject: [PATCH] Merge branch 'outcenter' of https://gitee.com/chonggaoxiao/new_excoin.git into outcenter --- src/main/java/com/xcong/excoin/common/system/controller/LoginController.java | 30 ++++++++++++++++++++++++++++-- 1 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java b/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java index e2bb955..27bcd67 100644 --- a/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java +++ b/src/main/java/com/xcong/excoin/common/system/controller/LoginController.java @@ -10,17 +10,24 @@ import cn.hutool.crypto.asymmetric.SignAlgorithm; import com.alibaba.fastjson.JSONObject; import com.xcong.excoin.common.LoginUserUtils; +import com.xcong.excoin.common.annotations.SubmitRepeat; import com.xcong.excoin.common.contants.AppContants; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.common.system.bean.LoginUserBean; import com.xcong.excoin.common.system.dto.LoginDto; +import com.xcong.excoin.common.system.dto.OutCenterRegisterDto; import com.xcong.excoin.common.system.dto.RegisterDto; +import com.xcong.excoin.common.system.dto.WtWalletDto; import com.xcong.excoin.configurations.properties.ApplicationProperties; import com.xcong.excoin.configurations.properties.SecurityProperties; +import com.xcong.excoin.modules.login.vo.LoginVo; import com.xcong.excoin.modules.member.service.MemberService; import com.xcong.excoin.utils.RedisUtils; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiResponse; +import io.swagger.annotations.ApiResponses; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -90,13 +97,13 @@ redisUtils.del(AppContants.PC_LOGIN_PREFIX + redisUtils.getString(redisMember)); } } - redisUtils.set(redisToken, JSONObject.toJSONString(loginUserBean), applicationProperties.getRedisExpire()); + redisUtils.set(redisToken, JSONObject.toJSONString(loginUserBean.getMemberEntity()), applicationProperties.getRedisExpire()); redisUtils.set(redisMember, token); Map<String, Object> authInfo = new HashMap<>(); // 开启debug模式,则将加密后的token返回 if (applicationProperties.isDebug()) { authInfo.put("token", token); - authInfo.put("rsaToken", generateAsaToken(token)); + authInfo.put("rsaToken", AppContants.TOKEN_START_WITH + generateAsaToken(token)); authInfo.put("user", loginUserBean); } else { authInfo.put("token", token); @@ -110,10 +117,29 @@ return rsa.encryptBase64(token + "_" + System.currentTimeMillis(), KeyType.PublicKey); } + //@SubmitRepeat @ApiOperation(value = "app注册接口", notes = "app注册接口,验证码必须输入可默认为123456") @PostMapping(value = "/register") public Result register(@RequestBody @Validated RegisterDto registerDto) { return memberservice.register(registerDto); } + + @ApiOperation(value = "创建接口", notes = "创建接口") + @PostMapping(value = "/registerOutCenter") + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = LoginVo.class), + }) + public Result registerOutCenter(@RequestBody @Validated OutCenterRegisterDto outCenterRegisterDto) { + return memberservice.registerOutCenter(outCenterRegisterDto); + } + + @ApiOperation(value = "导入接口", notes = "导入接口") + @PostMapping(value = "/loginOutCenter") + @ApiResponses({ + @ApiResponse(code = 200,message = "OK",response = LoginVo.class), + }) + public Result loginOutCenter(@RequestBody WtWalletDto wtWalletDto) { + return memberservice.recovery(wtWalletDto); + } } -- Gitblit v1.9.1