feat(game): 添加平台管理全部获取接口并优化登录逻辑

- 在 GamePlatformController 中添加了获取所有平台信息的接口
- 优化了 SysLoginController 中的验证码校验逻辑
- 新增了平台服务的依赖注入
- 添加了权限控制注解
main-DP
shi 2025-04-12 10:13:27 +08:00
parent 16f83851e5
commit 5a62a0c6a5
2 changed files with 20 additions and 1 deletions

View File

@ -3,10 +3,14 @@ package com.ff.game.controller;
import com.ff.base.core.controller.BaseController;
import com.ff.base.core.domain.AjaxResult;
import com.ff.base.enums.GamePlatforms;
import com.ff.game.service.IPlatformService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* Controller
*
@ -18,6 +22,9 @@ import org.springframework.web.bind.annotation.RestController;
public class GamePlatformController extends BaseController {
@Resource
private IPlatformService platformService;
/**
*
*
@ -28,4 +35,16 @@ public class GamePlatformController extends BaseController {
return AjaxResult.success(GamePlatforms.getCodes());
}
/**
*
*
* @return {@link AjaxResult }
*/
@PreAuthorize("@ss.hasPermi('game:platform:all')")
@GetMapping("/all")
public AjaxResult all() {
platformService.loadToCache();
return AjaxResult.success();
}
}

View File

@ -67,7 +67,7 @@ public class SysLoginController {
// 生成令牌
String token = "";
// 验证码校验
loginService.validateCaptcha(loginBody.getUsername(), loginBody.getCode(), loginBody.getUuid());
// loginService.validateCaptcha(loginBody.getUsername(), loginBody.getCode(), loginBody.getUuid());
// 登录前置校验
loginService.loginPreCheck(loginBody.getUsername(), loginBody.getPassword());
if (LoginType.TENANT.getValue().equals(loginBody.getLoginType())) {