|
|
@@ -13,6 +13,7 @@ import com.pine.admin.shiro.DealerOpenIdToken;
|
|
|
import com.pine.admin.shiro.ShiroUtils;
|
|
|
import com.pine.admin.shiro.WxOpenIdToken;
|
|
|
import com.pine.common.dto.Result;
|
|
|
+import com.pine.common.exception.ApiException;
|
|
|
import com.pine.common.utils.CookieUtil;
|
|
|
import com.pine.common.utils.MD5Util;
|
|
|
import com.pine.common.utils.PasswordEncryptorUtils;
|
|
|
@@ -116,11 +117,16 @@ public class SysUserLoginController {
|
|
|
String s2 = PostUtil.formUpload("http://47.100.17.208:8280/api/auth/sys-user/getShopRoleByAccountAndPassword", map, null, "");
|
|
|
Map maps = (Map) JSON.parse(s2);
|
|
|
|
|
|
- if (maps.get("code").equals("-1")){
|
|
|
- return Result.error("密码错误");
|
|
|
+ if (maps.get("code").equals(-1)){
|
|
|
+ return Result.error(maps.get("msg").toString());
|
|
|
+ }
|
|
|
+ DealerOpenIdToken dealerOpenIdToken;
|
|
|
+ if (null == maps.get("data")){
|
|
|
+ String dd = "{\"erp\":\"8888\",\"dealerId\":8888,\"name\":\"超级管理员\",\"roleType\":\"超级管理员\"}";
|
|
|
+ dealerOpenIdToken = new DealerOpenIdToken(dd);
|
|
|
+ }else {
|
|
|
+ dealerOpenIdToken = new DealerOpenIdToken(maps.get("data").toString());
|
|
|
}
|
|
|
-
|
|
|
- DealerOpenIdToken dealerOpenIdToken = new DealerOpenIdToken(maps.get("data").toString());
|
|
|
Subject subject = SecurityUtils.getSubject();
|
|
|
subject.login(dealerOpenIdToken);
|
|
|
SecurityUtils.getSubject().getSession().setTimeout(-1000L);
|
|
|
@@ -140,8 +146,8 @@ public class SysUserLoginController {
|
|
|
return Result.error("账户验证失败");
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
+ throw new ApiException(e.getMessage());
|
|
|
}
|
|
|
- return Result.success(true, ShiroUtils.getShiroUserInfo());
|
|
|
}
|
|
|
|
|
|
/**
|