🚀 后台登录管理
This commit is contained in:
parent
f8c44113a8
commit
7b759baeed
|
@ -0,0 +1,47 @@
|
|||
package com.atguigu.auth.controller;
|
||||
|
||||
import com.atguigu.common.result.Result;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 后台登录登出
|
||||
* </p>
|
||||
*/
|
||||
@Tag(name = "后台登录管理")
|
||||
@RestController
|
||||
@RequestMapping("/admin/system/index")
|
||||
public class IndexController {
|
||||
|
||||
@Operation(summary = "登录", description = "登录")
|
||||
@PostMapping("login")
|
||||
public Result<Map<String, Object>> login() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("token", "admin");
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取用户信息", description = "获取用户信息")
|
||||
@GetMapping("info")
|
||||
public Result<Map<String, Object>> info() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("roles", "[admin]");
|
||||
map.put("name", "admin");
|
||||
map.put("avatar", "https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
@Operation(summary = "退出", description = "退出")
|
||||
@PostMapping("logout")
|
||||
public Result<Map<String, Object>> logout() {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue