|
|
@@ -152,7 +152,7 @@ public class IndexService {
|
|
|
String phone = param.getLoginValue();
|
|
|
UserAuthLoginModel userAuthLoginModel = new UserAuthLoginModel();
|
|
|
BeanUtils.copyProperties(param, userAuthLoginModel);
|
|
|
- ResultContent resultContent = commonLogin(userAuthLoginModel);
|
|
|
+ ResultContent<LoginTokenModel> resultContent = commonLogin(userAuthLoginModel);
|
|
|
if (resultContent.isFailed()) {
|
|
|
return resultContent;
|
|
|
}
|
|
|
@@ -174,31 +174,14 @@ public class IndexService {
|
|
|
}
|
|
|
return ResultContent.buildFail(msg);
|
|
|
}
|
|
|
+ LoginTokenModel loginTokenModel = resultContent.getContent();
|
|
|
+ LoginPlatformTokenModel tokenModel = new LoginPlatformTokenModel();
|
|
|
+ com.zhongshu.card.server.core.util.BeanUtils.copyProperties(loginTokenModel, tokenModel);
|
|
|
+ tokenModel.setPlatformOid(organization.getOid());
|
|
|
+ OrganizationUserModel userModel = userAccountService.toOrgUserModel(organizationUser);
|
|
|
+ tokenModel.setUserInfo(userModel);
|
|
|
|
|
|
-// if (param.getLoginFromType() == LoginFromType.Platform) {
|
|
|
-// // web平台端登录
|
|
|
-// // 判断用户是否加入了平台端
|
|
|
-// Organization platformOrg = organizationDao.findTopByAuthType(AuthType.Platform);
|
|
|
-// if (ObjectUtils.isEmpty(platformOrg)) {
|
|
|
-// return ResultContent.buildFail("平台端数据未初始化,登录失败");
|
|
|
-// }
|
|
|
-// long number = organizationUserDao.countByUserAndStateAndAuthType(userAccount, UserState.Normal, AuthType.Platform);
|
|
|
-// if (number <= 0) {
|
|
|
-// return ResultContent.buildFail(String.format("用户不属于平台端用户,登录失败:%s", phone));
|
|
|
-// }
|
|
|
-// } else if (param.getLoginFromType() == LoginFromType.School) {
|
|
|
-// // 校园端web登录
|
|
|
-// long number = organizationUserDao.countByUserAndStateAndAuthType(userAccount, UserState.Normal, AuthType.School);
|
|
|
-// if (number <= 0) {
|
|
|
-// return ResultContent.buildFail(String.format("用户未加入学校,登录失败:%s", phone));
|
|
|
-// }
|
|
|
-// } else if (param.getLoginFromType() == LoginFromType.Shop) {
|
|
|
-// long number = organizationUserDao.countByUserAndStateAndAuthType(userAccount, UserState.Normal, AuthType.BusinessMain);
|
|
|
-// if (number <= 0) {
|
|
|
-// return ResultContent.buildFail(String.format("用户不属于任何商户,登录失败:%s", phone));
|
|
|
-// }
|
|
|
-// }
|
|
|
- return resultContent;
|
|
|
+ return ResultContent.buildSuccess(tokenModel);
|
|
|
}
|
|
|
|
|
|
public ResultContent<LoginTokenModel> commonLogin(UserAuthLoginModel userAuthLoginModel) {
|