sa两套鉴权合并为一套
This commit is contained in:
@@ -50,9 +50,8 @@ public class AuthorizationController {
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
@SaAdminCheckPermission("/adadas")
|
||||
@GetMapping("test")
|
||||
public CzgResult<?> login() {
|
||||
return CzgResult.success(Map.of("token", StpKit.ADMIN.getShopId()));
|
||||
return CzgResult.success(Map.of("token", StpKit.USER.getShopId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.czg.controller.user;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.czg.account.entity.UserInfo;
|
||||
import com.czg.account.service.UserInfoService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 用户信息管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
@Resource
|
||||
private UserInfoService userInfoService;
|
||||
|
||||
/**
|
||||
* 用户信息获取
|
||||
* @return 用户信息
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<UserInfo> get() {
|
||||
return CzgResult.success(userInfoService.getById(StpKit.USER.getLoginIdAsLong()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户信息获取
|
||||
* @return 用户信息
|
||||
*/
|
||||
// @GetMapping
|
||||
// public CzgResult<UserInfo> get() {
|
||||
// return CzgResult.success(userInfoService.getById(StpKit.USER.getLoginIdAsLong()));
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user