|
@@ -2,19 +2,18 @@
|
|
|
package com.ebei.device.asset.weixin.contorller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.util.ObjectUtil;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ebei.device.asset.weixin.auth.AuthUtils;
|
|
|
import com.ebei.device.asset.weixin.constant.Constants;
|
|
|
-import com.ebei.device.asset.weixin.model.entity.AssetTask;
|
|
|
import com.ebei.device.asset.weixin.model.entity.AssetTenantUser;
|
|
|
import com.ebei.device.asset.weixin.model.vo.AssetTenantUserVO;
|
|
|
import com.ebei.device.asset.weixin.service.AssetTenantUserService;
|
|
|
import com.ebei.device.asset.weixin.service.UserSessionManager;
|
|
|
import com.ebei.device.asset.weixin.util.MD5;
|
|
|
import com.ebei.device.asset.weixin.util.ResponseEx;
|
|
|
-import io.swagger.annotations.*;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
+import io.swagger.annotations.ApiParam;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
@@ -60,7 +59,7 @@ public class LoginController {
|
|
|
|
|
|
/*校验用户登录信息-------------------开始*/
|
|
|
boolean isOk = false;
|
|
|
- if (null != assetTenantUser) {
|
|
|
+ if (null != assetTenantUser && assetTenantUser.getUserAccount() != null) {
|
|
|
String pwdReal = assetTenantUser.getPwd();
|
|
|
String md5comparePwd = new MD5().getMD5ofStr(pwdReal);
|
|
|
if (null != pwd) {
|
|
@@ -78,10 +77,10 @@ public class LoginController {
|
|
|
result.put("companyId", assetTenantUser.getCompanyId());
|
|
|
result.put("userName", assetTenantUser.getUserName());
|
|
|
result.put("token", userSessionManager.createToken(assetTenantUser, companyId));
|
|
|
+ resultResponse = ResponseEx.createSuccess("登录成功", result);
|
|
|
} else {
|
|
|
resultResponse = ResponseEx.createError("无效的公司");
|
|
|
}
|
|
|
- resultResponse = ResponseEx.createSuccess("登录成功", result);
|
|
|
} else {
|
|
|
resultResponse = ResponseEx.createError("密码错误");
|
|
|
}
|