Commit 0e76b1ac authored by linruibiao's avatar linruibiao

接口编写

parent 29667bb4
......@@ -82,7 +82,8 @@ public class BaseRestController {
}
log.info("请求头参数--->>>>"+SlmConstants.gson.toJson(headers));
token=request.getHeader("token");
if(StringUtils.isEmpty(token)){
if(!uri.contains("tokens")) {
if (StringUtils.isEmpty(token)) {
throw new SysException("token不能为空");
}
log.info("获取用户信息");
......@@ -103,6 +104,8 @@ public class BaseRestController {
currentUser.setAppId(userInfo.get("app_id")+"");
currentUser.setToken(token);
request.getSession().setAttribute(token, SlmConstants.gson.toJson(currentUser));
}
}
R<Object> call(Action0 action) {
......
......@@ -24,7 +24,7 @@ import java.util.Map;
* @date : 2021-04-14 16:17
**/
@RestController
@RequestMapping("/token")
@RequestMapping("/tokens")
@Api(value ="获取token",tags = "获取token")
public class TokenController extends BaseRestController{
@PostMapping
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment