feat(game): 添加平台管理全部获取接口并优化登录逻辑
- 在 GamePlatformController 中添加了获取所有平台信息的接口 - 优化了 SysLoginController 中的验证码校验逻辑 - 新增了平台服务的依赖注入 - 添加了权限控制注解main-DP
parent
16f83851e5
commit
5a62a0c6a5
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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())) {
|
||||
|
|
Loading…
Reference in New Issue