From e3552c670fe7f2228d3d427e6bf3b4ab400ce8e2 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期日, 04 一月 2026 08:53:22 +0800
Subject: [PATCH] 更改头部
---
server/system_gateway/src/main/java/com/doumee/api/gateway/JwtAuthController.java | 46 +++++++++++++++++++++++++++++++++++++++-------
1 files changed, 39 insertions(+), 7 deletions(-)
diff --git a/server/system_gateway/src/main/java/com/doumee/api/gateway/JwtAuthController.java b/server/system_gateway/src/main/java/com/doumee/api/gateway/JwtAuthController.java
index 539f4d4..25974a0 100644
--- a/server/system_gateway/src/main/java/com/doumee/api/gateway/JwtAuthController.java
+++ b/server/system_gateway/src/main/java/com/doumee/api/gateway/JwtAuthController.java
@@ -1,11 +1,15 @@
package com.doumee.api.gateway;
+import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.annotation.LoginNoRequired;
import com.doumee.config.jwt.JwtProperties;
import com.doumee.config.jwt.JwtTokenUtil;
import com.doumee.core.annotation.pr.PreventRepeat;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
+import com.doumee.dao.system.dto.LoginCabinetDTO;
+import com.doumee.dao.system.dto.LoginH5DTO;
+import com.doumee.dao.system.vo.SystemConfigVo;
import com.doumee.service.business.third.model.ApiResponse;
import com.doumee.service.business.third.model.LoginUserInfo;
import com.doumee.core.utils.Constants;
@@ -42,6 +46,8 @@
private SystemLoginService systemLoginService;
@Autowired
private CaptchaService captchaService;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
/**
* @author Eva.Caesar Liu
@@ -53,6 +59,16 @@
return ApiResponse.success(captchaService.genCaptcha());
}
+ @PreventRepeat(limit = 10, lockTime = 10000)
+ @ApiOperation("鑾峰彇绯荤粺閰嶇疆鍙傛暟")
+ @GetMapping("/systemConfig")
+ @LoginNoRequired
+ public ApiResponse<SystemConfigVo> systemConfig ( ) {
+ SystemConfigVo configVo = new SystemConfigVo();
+ configVo.setSubtitle(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SYSTEM_SUBTITLE).getCode());
+ configVo.setTitle(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SYSTEM_TITLE).getCode());
+ return ApiResponse.success(configVo);
+ }
@PreventRepeat(limit = 10, lockTime = 10000)
@ApiOperation("鐧诲綍")
@PostMapping("/login")
@@ -97,11 +113,11 @@
@ApiOperation("H5涓氬姟鐧诲綍")
@PostMapping("/loginH5")
@LoginNoRequired
- public ApiResponse<String> loginH5 (@Validated @RequestBody LoginDTO dto, ServerWebExchange serverWebExchange) {
+ public ApiResponse<String> loginH5 (@Validated @RequestBody LoginH5DTO dto, ServerWebExchange serverWebExchange) {
try {
ServerHttpRequest request = serverWebExchange.getRequest();
dto.setCheckCode(false);
- LoginUserInfo user = systemLoginService.loginByPasswordNew(dto,request);
+ LoginUserInfo user = systemLoginService.loginH5(dto,request);
String token = jwtTokenUtil.generateToken(user);
return ApiResponse.success(token);
}catch (BusinessException e){
@@ -112,7 +128,7 @@
}
}
@PreventRepeat(limit = 10, lockTime = 10000)
- @ApiOperation("H5涓氬姟鐧诲綍")
+ @ApiOperation("H5涓氬姟鐧诲綍(鎵嬫満鍙烽獙璇佺爜鐧诲綍锛�")
@PostMapping("/loginH5ByPhone")
@LoginNoRequired
public ApiResponse<String> loginH5ByPhone (@Validated @RequestBody LoginPhoneDTO dto, ServerWebExchange serverWebExchange) {
@@ -170,7 +186,7 @@
@ApiOperation("鍙告満鐧诲綍")
@PostMapping("/loginDriver")
@LoginNoRequired
- public ApiResponse<String> loginDriver (@Validated @RequestBody LoginDTO dto, ServerWebExchange serverWebExchange) {
+ public ApiResponse<String> loginDriver (@Validated @RequestBody LoginH5DTO dto, ServerWebExchange serverWebExchange) {
try {
ServerHttpRequest request = serverWebExchange.getRequest();
dto.setCheckCode(false);
@@ -251,8 +267,6 @@
return ApiResponse.success(null);
}
-
-
@PostMapping("/logoutForH5")
@ApiOperation("閫�鍑虹櫥闄�")
public ApiResponse<String> logoutForH5(@RequestHeader(Constants.HEADER_USER_TOKEN) String oldToken){
@@ -264,7 +278,6 @@
return ApiResponse.failed(ResponseStatus.SERVER_ERROR);
}
return ApiResponse.success(null);
-
}
@@ -287,4 +300,23 @@
return ApiResponse.failed( "鐧诲綍宸插け鏁�");
}
+ @PreventRepeat(limit = 10, lockTime = 10000)
+ @ApiOperation("鐧诲綍 - 閽ュ寵鏌�")
+ @PostMapping("/loginCabinet")
+ @LoginNoRequired
+ public ApiResponse<String> loginCabinet (@Validated @RequestBody LoginCabinetDTO dto, ServerWebExchange serverWebExchange) {
+ try {
+ ServerHttpRequest request = serverWebExchange.getRequest();
+ LoginUserInfo user = systemLoginService.loginByPasswordForCabinet(dto,request);
+ String token = jwtTokenUtil.generateToken(user);
+ return ApiResponse.success(token);
+ }catch (BusinessException e){
+ return ApiResponse.failed(e.getCode(),e.getMessage());
+ }catch (Exception e){
+ e.printStackTrace();
+ return ApiResponse.failed(ResponseStatus.SERVER_ERROR);
+ }
+ }
+
+
}
\ No newline at end of file
--
Gitblit v1.9.3