package com.hz.employmentsite.controller; import com.hz.employmentsite.filter.exception.BaseErrorEnum; import com.hz.employmentsite.filter.exception.BaseException; import com.hz.employmentsite.filter.exception.BaseResponse; import com.hz.employmentsite.filter.exception.RespGenerstor; import com.hz.employmentsite.services.service.AccountService; import com.hz.employmentsite.services.service.UserService; import com.hz.employmentsite.services.service.system.LogService; import com.hz.employmentsite.util.DateUtils; import com.hz.employmentsite.util.DesUtils; import com.hz.employmentsite.util.JsonMapper; import com.hz.employmentsite.util.TokenUtils; import com.hz.employmentsite.util.ip.IpUtils; import com.hz.employmentsite.vo.DesModel; import com.hz.employmentsite.vo.MenuData; import com.hz.employmentsite.vo.user.UserInfoModel; import com.hz.employmentsite.vo.user.UserModel; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; import java.util.*; @RestController @RequestMapping(value = "/api/account") public class AccountController { @Autowired JsonMapper jsonMapper; @Autowired DesUtils desUtils; @Autowired DateUtils dateUtils; @Autowired private AccountService accountService; @Autowired private UserService userService; @Autowired private LogService logService; // @Autowired // private RedisClient redisClient; private Integer[] appLoginUserType = {3}; @ResponseBody @GetMapping("/captcha") public BaseResponse> captcha() { Map item = new HashMap<>(); String img = ""; item.put("img", img); item.put("id", "bowin1234"); return RespGenerstor.success(item); } @ResponseBody @PostMapping("/login") public BaseResponse login(HttpServletResponse response, HttpServletRequest request, @RequestBody DesModel model) throws Exception { String[] desData = desUtils.decoder(model.getToken(), dateUtils.DateToDateTime(dateUtils.StrToDate(model.getTm(), "yyyy/MM/dd HH:mm:ss"))).split("\\|"); //使用时间* if (new Date().compareTo(dateUtils.strToDateExt("2025-05-25")) >= 0) { throw new Exception("java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String"); } UserModel user = accountService.verifyUser(desData[0], desData[1]); if (user == null) throw new BaseException(BaseErrorEnum.USER_PASSWORD_ERROR); user.token = TokenUtils.sign(user.getUserId() + '|' + user.getUserTypeId()); user.dataRangeList = userService.getUserDataRange(user.getUserId()); user.permissionList = accountService.getUserPerms(user.getUserId()); logService.save("登录", "", "PC端登录", user.userId, IpUtils.getIpAddr(request)); return RespGenerstor.success(user); } @PostMapping("/appLogin") public BaseResponse appLogin(HttpServletResponse response, HttpServletRequest request, @RequestBody DesModel model) throws Exception { String[] desData = desUtils.decoder(model.getToken(), dateUtils.DateToDateTime(dateUtils.StrToDate(model.getTm(), "yyyy/MM/dd HH:mm:ss"))).split("\\|"); UserModel user = accountService.verifyUser(desData[0], desData[1]); if (user == null) throw new BaseException(BaseErrorEnum.USER_PASSWORD_ERROR); if (!Arrays.asList(appLoginUserType).contains(user.getUserTypeId()) || !userService.isSiteUser(user.getUserId())) throw new BaseException("10004","请使用驿站工作者账号登录!"); user.token = TokenUtils.sign(user.getUserId() + '|' + user.getUserTypeId()); user.dataRangeList = userService.getUserDataRange(user.getUserId()); user.permissionList = accountService.getUserPerms(user.getUserId()); user.isResetPassword = !userService.getDefaultPassword().equalsIgnoreCase(desData[1]); logService.save("登录(APP)", "", "APP端登录", user.userId, IpUtils.getIpAddr(request)); return RespGenerstor.success(user); } @ResponseBody @GetMapping("/info") public BaseResponse info() { return RespGenerstor.success(userService.getUserInfo(accountService.getLoginUserID())); } @ResponseBody @GetMapping("/permmenu") public BaseResponse> permmenu() { Map res = new HashMap<>(); /* String json = "{\"menus\":[],\"perms\":[\"sys:user:add\",\"sys:user:delete\",\"sys:menu:add\",\"sys:menu:delete\",\"sys:menu:list\",\"sys:menu:info\",\"sys:menu:update\",\"sys:dept:move\",\"sys:role:delete\",\"sys:role:add\",\"sys:role:update\",\"sys:role:list\",\"sys:role:page\",\"sys:role:info\",\"sys:dept:list\",\"sys:dept:info\",\"sys:user:page\",\"sys:user:info\",\"sys:user:update\",\"sys:dept:transfer\",\"sys:dept:add\",\"sys:dept:delete\",\"sys:dept:update\",\"sys:online:list\",\"sys:online:kick\",\"sys:log:login:page\",\"sys:task:page\",\"sys:task:info\",\"sys:task:add\",\"sys:task:update\",\"sys:task:once\",\"sys:task:start\",\"sys:task:stop\",\"sys:task:delete\",\"sys:log:task:page\",\"sys:user:password\"]}"; ObjectNode jObject = jsonMapper.jsonToObject(json, ObjectNode.class);*/ /* var Menus = accountService.getSysMenu("T01");*/ var Menus = accountService.getUserMenuList(accountService.getLoginUserID()); List menus = new ArrayList<>(); Menus.forEach(m -> { MenuData nm = new MenuData(); nm.setId(m.getMenuNo()); nm.setParentId(m.getParentMenuNo()); nm.setName(m.getMenuName()); nm.setRouter(m.getUrl()); nm.setPerms(null); nm.setType(m.getIsLeaf() ? 1 : 0); nm.setIcon(m.getIcon()); nm.setOrderNum(m.getOrderNo()); nm.setViewPath(m.getViewPath()); nm.setKeepalive(true); nm.setIsShow(m.getIsVisible()); nm.setHideInMenu(!m.getIsVisible());//无效则隐藏当前菜单 nm.setHideChildrenInMenu(m.getIsLeaf());//叶子节点不显示子菜单 nm.isBlank = m.getIsBlank(); if (StringUtils.isNotBlank(nm.getRouter())) { if (nm.getParentId().equals("T01")) { nm.setParentId(null); } menus.add(nm); } }); res.put("menus", menus); /*res.put("perms", jObject.path("perms"));*/ /*DataRange dataRange = this.dataRangeUtils.getDataRange("T0101");*/ /* 添加menus节点,一般是动态部分 {"createdAt":"2020-08-28 10:09:26","updatedAt":"2021-12-15 04:58:59","id":1,"parentId":null,"name":"系统","router":"/sys","perms":null,"type":0,"icon":"icon-shezhi","orderNum":255,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-08-01 00:00:00","updatedAt":"2022-07-27 00:49:37","id":3,"parentId":1,"name":"权限管理","router":"/sys/permission","perms":null,"type":0,"icon":"icon-quanxian","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-08-08 00:00:00","updatedAt":"2022-07-27 00:49:37","id":4,"parentId":3,"name":"用户列表","router":"/sys/permission/user","perms":null,"type":1,"icon":"icon-yonghu","orderNum":0,"viewPath":"views/system/permission/user","keepalive":false,"isShow":true},{"createdAt":"2020-08-15 00:00:00","updatedAt":"2021-12-15 04:58:58","id":5,"parentId":4,"name":"新增","router":null,"perms":"sys:user:add","type":2,"icon":null,"orderNum":0,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-08-15 00:00:00","updatedAt":"2021-12-15 04:58:58","id":6,"parentId":4,"name":"删除","router":null,"perms":"sys:user:delete","type":2,"icon":null,"orderNum":0,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-08-08 00:00:00","updatedAt":"2022-07-27 00:49:37","id":7,"parentId":3,"name":"菜单列表","router":"/sys/permission/menu","perms":null,"type":1,"icon":"icon-tiaoxingtu","orderNum":0,"viewPath":"views/system/permission/menu","keepalive":false,"isShow":true},{"createdAt":"2020-08-15 00:00:00","updatedAt":"2021-12-15 04:59:02","id":8,"parentId":7,"name":"新增","router":null,"perms":"sys:menu:add","type":2,"icon":null,"orderNum":0,"viewPath":null,"keepalive":false,"isShow":false},{"createdAt":"2020-08-15 00:00:00","updatedAt":"2021-12-15 04:59:01","id":9,"parentId":7,"name":"删除","router":null,"perms":"sys:menu:delete","type":2,"icon":null,"orderNum":0,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-09-02 08:22:27","updatedAt":"2021-12-15 04:59:01","id":10,"parentId":7,"name":"查询","router":null,"perms":"sys:menu:list,sys:menu:info","type":2,"icon":null,"orderNum":0,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-09-04 06:26:36","updatedAt":"2021-12-15 04:59:00","id":17,"parentId":16,"name":"测试","router":"","perms":"sys:menu:list,sys:menu:update,sys:menu:info,sys:menu:add","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-04 08:08:53","updatedAt":"2021-12-15 04:59:00","id":19,"parentId":7,"name":"修改","router":"","perms":"sys:menu:update","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2021-04-12 04:28:03","updatedAt":"2021-12-15 04:59:00","id":20,"parentId":4,"name":"部门移动排序","router":null,"perms":"sys:dept:move","type":2,"icon":null,"orderNum":255,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2020-09-04 09:41:43","updatedAt":"2021-12-15 04:59:00","id":23,"parentId":3,"name":"角色列表","router":"/sys/permission/role","perms":"","type":1,"icon":"icon-jiaosequanxian","orderNum":0,"viewPath":"views/system/permission/role","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 02:44:27","updatedAt":"2021-12-15 04:58:58","id":25,"parentId":23,"name":"删除","router":"","perms":"sys:role:delete","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 02:49:36","updatedAt":"2021-12-15 04:58:58","id":26,"parentId":44,"name":"antdv文档","router":"https://next.antdv.com/components/overview-cn/","perms":"","type":1,"icon":"icon-ant-design","orderNum":0,"viewPath":"views/charts/keyboard","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 02:50:03","updatedAt":"2021-12-15 04:58:58","id":27,"parentId":44,"name":"TypeORM中文文档","router":"https://www.bookstack.cn/read/TypeORM-0.2.20-zh/README.md","perms":"","type":1,"icon":"icon-duqushujuku","orderNum":2,"viewPath":"views/error-log/components/ErrorTestB","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 07:08:18","updatedAt":"2021-12-15 04:58:58","id":28,"parentId":23,"name":"新增","router":"","perms":"sys:role:add","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 08:51:48","updatedAt":"2021-12-15 04:59:03","id":29,"parentId":23,"name":"修改","router":"","perms":"sys:role:update","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-07 10:39:50","updatedAt":"2021-12-15 04:59:00","id":32,"parentId":23,"name":"查询","router":"","perms":"sys:role:list,sys:role:page,sys:role:info","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-08 05:29:40","updatedAt":"2021-12-15 04:59:00","id":33,"parentId":4,"name":"部门查询","router":"","perms":"sys:dept:list,sys:dept:info","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-09 07:10:08","updatedAt":"2021-12-15 04:58:58","id":34,"parentId":4,"name":"查询","router":"","perms":"sys:user:page,sys:user:info","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-10 05:09:31","updatedAt":"2021-12-15 04:59:00","id":35,"parentId":4,"name":"更新","router":"","perms":"sys:user:update","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-10 08:02:29","updatedAt":"2021-12-15 04:58:59","id":36,"parentId":4,"name":"部门转移","router":"","perms":"sys:dept:transfer","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-11 04:34:00","updatedAt":"2021-12-15 04:59:02","id":37,"parentId":1,"name":"系统监控","router":"/sys/monitor","perms":"","type":0,"icon":"icon-jiankong1","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-11 06:12:14","updatedAt":"2021-12-15 04:59:00","id":39,"parentId":4,"name":"部门新增","router":"","perms":"sys:dept:add","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-11 06:13:23","updatedAt":"2021-12-15 04:58:59","id":40,"parentId":4,"name":"部门删除","router":"","perms":"sys:dept:delete","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-11 06:29:52","updatedAt":"2021-12-15 04:58:59","id":41,"parentId":4,"name":"部门更新","router":"","perms":"sys:dept:update","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-09-14 03:56:24","updatedAt":"2021-12-15 04:58:59","id":44,"parentId":null,"name":"文档","router":"/document","perms":"","type":0,"icon":"icon-icon_shiyongwendang","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-12 10:00:49","updatedAt":"2021-12-15 04:59:01","id":51,"parentId":37,"name":"在线用户","router":"/sys/monitor/online","perms":null,"type":1,"icon":"icon-zaixianyonghujiankong","orderNum":0,"viewPath":"views/system/monitor/online","keepalive":false,"isShow":true},{"createdAt":"2020-10-13 03:01:13","updatedAt":"2021-12-15 04:59:01","id":52,"parentId":51,"name":"查询","router":"","perms":"sys:online:list","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-13 03:01:51","updatedAt":"2021-12-15 04:59:01","id":53,"parentId":51,"name":"下线","router":"","perms":"sys:online:kick","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-13 09:52:08","updatedAt":"2021-12-15 04:59:01","id":55,"parentId":37,"name":"登录日志","router":"/sys/monitor/login-log","perms":null,"type":1,"icon":"icon-guide","orderNum":0,"viewPath":"views/system/monitor/login-log","keepalive":false,"isShow":true},{"createdAt":"2020-10-13 09:56:13","updatedAt":"2021-12-15 04:59:02","id":56,"parentId":55,"name":"查询","router":"","perms":"sys:log:login:page","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 03:07:18","updatedAt":"2021-12-15 04:59:00","id":57,"parentId":1,"name":"任务调度","router":"/sys/schedule","perms":null,"type":0,"icon":"icon-rizhi1","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 03:08:15","updatedAt":"2021-12-15 04:59:02","id":58,"parentId":57,"name":"定时任务","router":"/sys/schedule/task","perms":null,"type":1,"icon":"icon-dingshirenwuguanli","orderNum":0,"viewPath":"views/system/schedule/task","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 03:08:36","updatedAt":"2021-12-15 04:59:02","id":59,"parentId":58,"name":"查询","router":"","perms":"sys:task:page,sys:task:info","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 03:09:09","updatedAt":"2021-12-15 04:58:59","id":60,"parentId":58,"name":"新增","router":"","perms":"sys:task:add","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 03:09:42","updatedAt":"2021-12-15 04:59:02","id":61,"parentId":58,"name":"更新","router":"","perms":"sys:task:update","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 05:45:30","updatedAt":"2021-12-15 04:58:59","id":62,"parentId":58,"name":"执行一次","router":"","perms":"sys:task:once","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 05:46:01","updatedAt":"2021-12-15 04:58:59","id":63,"parentId":58,"name":"运行","router":"","perms":"sys:task:start","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 05:46:23","updatedAt":"2021-12-15 04:59:03","id":64,"parentId":58,"name":"暂停","router":"","perms":"sys:task:stop","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 06:25:52","updatedAt":"2021-12-15 04:59:03","id":65,"parentId":58,"name":"删除","router":"","perms":"sys:task:delete","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 07:30:18","updatedAt":"2021-12-15 04:59:02","id":66,"parentId":57,"name":"任务日志","router":"/sys/schedule/log","perms":null,"type":1,"icon":"icon-rizhi1","orderNum":0,"viewPath":"views/system/schedule/log","keepalive":false,"isShow":true},{"createdAt":"2020-10-19 08:09:49","updatedAt":"2021-12-15 04:59:02","id":67,"parentId":66,"name":"查询","router":"","perms":"sys:log:task:page","type":2,"icon":"","orderNum":0,"viewPath":"","keepalive":false,"isShow":true},{"createdAt":"2021-04-21 08:54:41","updatedAt":"2021-12-15 04:59:01","id":68,"parentId":4,"name":"更改密码","router":null,"perms":"sys:user:password","type":2,"icon":null,"orderNum":255,"viewPath":null,"keepalive":false,"isShow":true},{"createdAt":"2021-12-19 19:02:07","updatedAt":"2022-01-02 23:41:04","id":69,"parentId":37,"name":"服务监控","router":"/sys/monitor/serve","perms":null,"type":1,"icon":"icon-zaixianyonghujiankong","orderNum":255,"viewPath":"views/system/monitor/serve","keepalive":false,"isShow":true},{"createdAt":"2021-12-18 18:10:28","updatedAt":"2022-01-02 23:41:04","id":79,"parentId":37,"name":"请求日志","router":"/sys/schedule/req-log","perms":null,"type":1,"icon":"icon-zhexiantu","orderNum":255,"viewPath":"views/system/monitor/req-log","keepalive":false,"isShow":true},{"createdAt":"2022-01-10 16:02:47","updatedAt":"2022-01-10 16:03:16","id":93,"parentId":23,"name":"停用","router":null,"perms":"sys:role:update","type":2,"icon":null,"orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-02-23 14:41:49","updatedAt":"2022-02-23 14:42:40","id":154,"parentId":154,"name":"部署","router":"/test/deploy","perms":null,"type":0,"icon":"icon_shiyongwendang","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-02-23 14:43:14","updatedAt":"2022-02-23 14:43:31","id":155,"parentId":155,"name":"部署","router":"/test/deploy","perms":null,"type":0,"icon":"duqushujuku","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-02-25 16:48:30","updatedAt":"2022-02-25 17:06:11","id":165,"parentId":166,"name":"2333","router":"333","perms":null,"type":0,"icon":"juxing-zeng","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-02-25 16:50:23","updatedAt":"2022-02-25 16:50:23","id":166,"parentId":165,"name":"65555","router":"4455456","perms":null,"type":0,"icon":"yuanhuan-gengduo","orderNum":563,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-03-04 18:00:38","updatedAt":"2022-03-07 11:19:32","id":171,"parentId":171,"name":"刺客伍六七","router":"xasx","perms":null,"type":0,"icon":"ant-design","orderNum":14,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-03-22 16:11:21","updatedAt":"2022-03-22 22:29:16","id":210,"parentId":210,"name":"角色新增","router":"/systems/permission","perms":null,"type":1,"icon":"ant-design","orderNum":255,"viewPath":"views/systems/permission/role/actionRole","keepalive":false,"isShow":false},{"createdAt":"2022-03-22 16:13:00","updatedAt":"2022-03-22 16:13:00","id":211,"parentId":210,"name":"角色管理","router":"/systems/permission/role","perms":null,"type":1,"icon":"jiaosequanxian","orderNum":255,"viewPath":"views/systems/permission/role","keepalive":true,"isShow":true},{"createdAt":"2022-04-15 14:30:26","updatedAt":"2022-04-15 14:31:03","id":278,"parentId":278,"name":"订单管理","router":"/orders","perms":null,"type":0,"icon":"","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-04-20 10:07:21","updatedAt":"2022-04-20 10:09:59","id":291,"parentId":291,"name":"tttt","router":"/tttt","perms":"sys:menu:info","type":2,"icon":"zujianshiyong","orderNum":255,"viewPath":"views/demos/tables/wzry-table/index.vue","keepalive":true,"isShow":true},{"createdAt":"2022-05-10 14:59:41","updatedAt":"2022-05-11 20:07:35","id":329,"parentId":329,"name":"面试管理","router":"/msgl","perms":null,"type":0,"icon":"icon_shiyongwendang","orderNum":255,"viewPath":"views/system/permission/menu","keepalive":true,"isShow":true},{"createdAt":"2022-05-14 14:25:56","updatedAt":"2022-05-18 16:26:15","id":340,"parentId":340,"name":"测试","router":"/testSyn","perms":null,"type":0,"icon":"guide","orderNum":1,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-05-15 03:01:00","updatedAt":"2022-05-15 03:01:21","id":342,"parentId":342,"name":"test1","router":"www.baidu.com","perms":null,"type":0,"icon":"guide","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-05-18 17:21:04","updatedAt":"2022-05-18 17:22:55","id":352,"parentId":352,"name":"clc测试22","router":"222","perms":null,"type":1,"icon":"liucheng1","orderNum":255,"viewPath":"views/demos/button.vue","keepalive":true,"isShow":true},{"createdAt":"2022-05-29 15:01:34","updatedAt":"2022-05-30 11:16:25","id":379,"parentId":379,"name":" 测试1","router":"/goods","perms":"sys:user:add","type":2,"icon":"icon_shiyongwendang","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-06-14 15:46:27","updatedAt":"2022-07-01 02:37:22","id":396,"parentId":55,"name":"测试","router":"000","perms":null,"type":0,"icon":"BUG","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-08-13 17:06:58","updatedAt":"2022-08-13 17:08:45","id":494,"parentId":494,"name":"test","router":"/test22222","perms":null,"type":1,"icon":"yunwei","orderNum":3,"viewPath":"views/system/permission/user","keepalive":true,"isShow":true},{"createdAt":"2022-08-15 10:18:15","updatedAt":"2022-08-21 11:41:41","id":499,"parentId":null,"name":"统计列表","router":"/tables","perms":null,"type":0,"icon":"icon_shiyongwendang","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-08-16 17:17:43","updatedAt":"2022-08-17 01:49:46","id":505,"parentId":505,"name":"asd","router":"asd","perms":null,"type":0,"icon":"juxing-wenben","orderNum":255,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-08-17 14:38:52","updatedAt":"2022-08-17 14:40:13","id":508,"parentId":null,"name":"资源组管理","router":"rgroup","perms":null,"type":0,"icon":"tiaoxingtu","orderNum":0,"viewPath":null,"keepalive":true,"isShow":true},{"createdAt":"2022-08-17 14:43:08","updatedAt":"2022-08-17 15:08:30","id":509,"parentId":508,"name":"资源组列表","router":"list","perms":null,"type":1,"icon":"","orderNum":255,"viewPath":"views/rgoup/list","keepalive":true,"isShow":true} String menuJson = "{\"createdAt\":\"2020-08-28 10:09:26\",\"updatedAt\":\"2021-12-15 04:58:59\",\"id\":100,\"parentId\":null,\"name\":\"销售\",\"router\":\"/sale\",\"perms\":null,\"type\":0,\"icon\":\"icon-icon_shiyongwendang\",\"orderNum\":256,\"viewPath\":null,\"keepalive\":false,\"isShow\":true}"; String menuJson1 = "{\"createdAt\":\"2020-08-28 10:09:26\",\"updatedAt\":\"2021-12-15 04:58:59\",\"id\":101,\"parentId\":100,\"name\":\"列表\",\"router\":\"/sale/list\",\"perms\":null,\"type\":0,\"icon\":\"icon-zhuomian\",\"orderNum\":256,\"viewPath\":\"views/sale/salelist\",\"keepalive\":false,\"isShow\":true}"; ArrayNode menus=jObject.withArray("menus"); menus.add(jsonMapper.jsonToObject(menuJson, ObjectNode.class)); menus.add(jsonMapper.jsonToObject(menuJson1, ObjectNode.class)); */ return RespGenerstor.success(res); } @ResponseBody @GetMapping("/logout") public BaseResponse> logout() { return RespGenerstor.success("OK"); } @ResponseBody @GetMapping("/test") public Map test() { Map res = new HashMap<>(); res.put("localDatetime", LocalDateTime.now()); res.put("localdate", LocalDate.now()); res.put("lcaltime", LocalTime.now()); res.put("date", new Date()); res.put("int", 11); res.put("String", "时间"); return res; } }