| | |
| | | @PostMapping("/applicationOrdering") |
| | | public JSONObject order (@RequestBody TidePojo tidePojo) { |
| | | SysUser user = userService.selectUserByUserName(tidePojo.getPltAccountLogin()); |
| | | String randomString = TideUtils.getRandomString(12); |
| | | String defaultPwd = "I73Kj+Mn$+SI";//默认开通密码固定写死 |
| | | // String randomString = TideUtils.getRandomString(12); |
| | | //账号不存在,执行新增操作 |
| | | if(Objects.isNull(user)){ |
| | | user = new SysUser(); |
| | | String password = SecurityUtils.encryptPassword(randomString); |
| | | String password = SecurityUtils.encryptPassword(defaultPwd); |
| | | user.setPassword(password); |
| | | user.setUserName(tidePojo.getPltAccountLogin()); |
| | | user.setNickName(tidePojo.getEnterpriseName()); |
| | |
| | | user.setDelFlag("0"); |
| | | user.setPostIds(new Long[]{1L}); |
| | | user.setRoleId(1L); |
| | | user.setDeptIds(new Long[]{100L}); |
| | | userService.insertUser(user); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("account", tidePojo.getPltAccountLogin()); |
| | | map.put("token", randomString); |
| | | map.put("token", defaultPwd); |
| | | map.put("tenantId", user.getUserId()); |
| | | return TideUtils.getResult(20000, "成功", map); |
| | | } |