提交 62edfdbb 作者: zhenjie

Merge branch 'develop' of ssh://git.mmcuav.cn:8222/iuav/cms into develop

package com.mmc.iuav.user.auth; package com.mmc.iuav.user.auth;
import com.alibaba.fastjson2.JSONObject;
import com.mmc.iuav.response.ResultBody; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.response.ResultEnum; import com.mmc.iuav.response.ResultEnum;
import com.mmc.iuav.user.model.dto.LoginSuccessDTO;
import com.mmc.iuav.user.util.PathUtil; import com.mmc.iuav.user.util.PathUtil;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
......
package com.mmc.iuav.user.controller; package com.mmc.iuav.user.controller;
import com.mmc.iuav.group.Insert; import javax.servlet.http.HttpServletRequest;
import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.model.vo.AppUserSucVO;
import com.mmc.iuav.user.model.vo.WxLoginVO;
import com.mmc.iuav.user.service.AuthService;
import com.mmc.iuav.user.service.UserAccountService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import com.mmc.iuav.response.ResultBody;
import com.mmc.iuav.user.service.AuthService;
import io.swagger.annotations.*;
/** /**
* @author: zj * @author: zj
...@@ -20,7 +17,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -20,7 +17,7 @@ import javax.servlet.http.HttpServletRequest;
@Api(tags = "临时登录授权") @Api(tags = "临时登录授权")
@RequestMapping("/temp-auth/") @RequestMapping("/temp-auth/")
@RestController @RestController
public class TempLoginController extends BaseController{ public class TempLoginController extends BaseController {
@Autowired @Autowired
private AuthService authService; private AuthService authService;
...@@ -35,8 +32,13 @@ public class TempLoginController extends BaseController{ ...@@ -35,8 +32,13 @@ public class TempLoginController extends BaseController{
@ApiOperation(value = "查询登录信息") @ApiOperation(value = "查询登录信息")
@ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) }) @ApiResponses({ @ApiResponse(code = 200, message = "OK", response = ResultBody.class) })
@GetMapping("getLoginInfo") @GetMapping("getLoginInfo")
public ResultBody getLoginInfo(@ApiParam(value = "临时登录code",example = "kj6d9wcxyp92jajugdnc") @RequestParam String randomLoginCode){ public ResultBody getLoginInfo(
@ApiParam(value = "临时登录code", example = "kj6d9wcxyp92jajugdnc") @RequestParam String randomLoginCode) {
return authService.getLoginInfo(randomLoginCode); return authService.getLoginInfo(randomLoginCode);
} }
//test
} }
...@@ -157,12 +157,12 @@ public class AuthServiceImpl implements AuthService { ...@@ -157,12 +157,12 @@ public class AuthServiceImpl implements AuthService {
map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN); map.put(JwtConstant.TOKEN_TYPE, JwtConstant.M_TOKEN);
String token = JwtUtil.createJwt(map); String token = JwtUtil.createJwt(map);
LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getUid()) LoginSuccessDTO loginSuccessDTO = LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).uid(user.getUid())
.userName(user.getUserName()).nickName(user.getNickName()).phoneNum(user.getPhoneNum()).portType(0).build(); .userName(user.getUserName()).nickName(user.getNickName()).phoneNum(user.getPhoneNum()).build();
stringRedisTemplate.opsForValue().set( stringRedisTemplate.opsForValue().set(
token, JSONObject.toJSONString(loginSuccessDTO), token, JSONObject.toJSONString(loginSuccessDTO),
JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS); JwtConstant.EXPIRATION, TimeUnit.MILLISECONDS);
return ResultBody.success(LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).portType(0).build()); return ResultBody.success(LoginSuccessDTO.builder().token(token).userAccountId(user.getId()).accountNo(user.getAccountNo()).build());
} }
@Override @Override
......
...@@ -17,4 +17,4 @@ patches: ...@@ -17,4 +17,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/cms
newTag: 5411acd1277940438d815b52edb47865fb8e516c newTag: 103f6b2eedf37c274d8c8c72b40538bd0846ad05
...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/cms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly/cms
newTag: aff8b6d5d24d7859a41467f17bce510670143837 newTag: f3feaca2b4ecd07343122ef2a7b3bfd8e40a9b19
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论