Commit 66927f7d authored by 赵啸非's avatar 赵啸非

修改导出动态列

parent 2782a57e
......@@ -63,6 +63,14 @@ public class ApiLoginController extends BaseJsonBodyController {
JSONObject ret = new JSONObject();
JSONObject data = new JSONObject();
String loginName = loginForm.getLoginName();
String password = loginForm.getPassword();
String ip = super.getRequestIP(request);
if (StringUtils.isEmpty(loginName) || StringUtils.isEmpty(password)) {
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, "未获取到用户信息,请重新登录");
return ret.toJSONString();
}
UserEntity userEntity = null;
try {
if (ObjectUtils.isEmpty(loginForm.getCode())) {
......@@ -73,7 +81,8 @@ public class ApiLoginController extends BaseJsonBodyController {
if (personRest.getCode() != YesNoEnum.YES.getValue()) {
throw new AppException(DING_AUTH_FAIL,String.format("获取钉钉用户异常,%s", personRest.getMsg()));
}
log.info(personRest.getData());
userEntity = userService.doLogin(loginName, password, ip);
if (!ObjectUtils.isEmpty(loginForm.getCode())) {
//更新绑定钉钉
userEntity.setDingUserId(loginForm.getCode());
......
......@@ -67,22 +67,10 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
@Autowired
private UserService userService;
@Autowired
private ValidCodeService validCodeService;
@Autowired
private ResourceService resourceService;
@Autowired
private MenuService menuService;
@Autowired
private ICacheService cacheService;
@Autowired
private IAuthTokenService authTokenService;
@Autowired
private StaffService staffService;
@Autowired
private DeptService deptService;
@Autowired
private IDingPersonService dingPersonService;
......@@ -104,7 +92,6 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
throw new AppException(String.format("获取钉钉用户异常,%s", personRest.getMsg()));
}
log.info(personRest.getData());
if (ObjectUtils.isEmpty(personRest.getData()))
throw new AppException(1012, "未找到响应的钉钉用户!");
//根据钉钉的用户查询系统绑定的用户,获取
......@@ -120,7 +107,7 @@ public class DingTalkLoginController extends BaseCRUDJsonBodyMappingController<U
data.put("userType", userEntity.getUserType());
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
userEntity.setExpireTime(DateUtils.addCurrDate(1).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
ret.put(KEY_RESULT_DATA, data);
......
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