|
@@ -1,9 +1,11 @@
|
|
|
package com.roma.romaapi.controller;
|
|
package com.roma.romaapi.controller;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+import com.roma.romaapi.service.ApiService;
|
|
|
import com.roma.romaapi.service.CaptchaService;
|
|
import com.roma.romaapi.service.CaptchaService;
|
|
|
import com.roma.romaapi.utils.CustomResponse;
|
|
import com.roma.romaapi.utils.CustomResponse;
|
|
|
import com.roma.romaapi.utils.UUIDUtil;
|
|
import com.roma.romaapi.utils.UUIDUtil;
|
|
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
@@ -26,6 +28,8 @@ public class ApiController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
CaptchaService captchaService;
|
|
CaptchaService captchaService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
|
|
+ ApiService apiService;
|
|
|
|
|
+ @Autowired
|
|
|
private UUIDUtil uuidUtil;
|
|
private UUIDUtil uuidUtil;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
private RedisTemplate<String, String> redisTemplate;
|
|
@@ -37,8 +41,9 @@ public class ApiController {
|
|
|
|
|
|
|
|
// 登录系统
|
|
// 登录系统
|
|
|
@RequestMapping("/api/login")
|
|
@RequestMapping("/api/login")
|
|
|
- public Map login(){
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public Map login(HttpServletRequest request){
|
|
|
|
|
+ Map<String, String[]> maps = request.getParameterMap();
|
|
|
|
|
+ apiService.login(maps);
|
|
|
Map ret = new HashMap();
|
|
Map ret = new HashMap();
|
|
|
String key = uuidUtil.getUUID32();
|
|
String key = uuidUtil.getUUID32();
|
|
|
ret.put("token", key);
|
|
ret.put("token", key);
|