Commit 9de5ca1c authored by 赵啸非's avatar 赵啸非

添加用户登录鉴权

parent 4344ccab
......@@ -5,6 +5,7 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.ICacheService;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.framework.annotation.Operlog;
import com.mortals.xhx.module.area.model.AreaQuery;
......@@ -68,6 +69,8 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
private RoleUserService roleUserService;
@Autowired
private RoleService roleService;
@Autowired
private ICacheService cacheService;
public UserController() {
super.setModuleDesc("用户信息业务");
......@@ -192,4 +195,21 @@ public class UserController extends BaseCRUDJsonBodyMappingController<UserServic
}
return ret.toJSONString();
}
/**
* 获取验证token
* @return
*/
@GetMapping(value = "token")
public Rest<String> getToken(@RequestParam(value = "userKey") String userKey) {
try {
String userStr = cacheService.get(userKey);
return Rest.ok(userStr);
} catch (Exception e) {
log.error("查询token错误", e);
return Rest.fail("获取token异常!");
}
}
}
\ No newline at end of file
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