zhangqiankun 3 лет назад
Родитель
Сommit
44b2b23103

+ 3 - 0
saas-account/src/main/java/com/persagy/person/controller/SaasAccountController.java

@@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
+import com.google.common.collect.Sets;
 import com.persagy.common.constant.SaasCommonConstant;
 import com.persagy.common.enums.ResponseCode;
 import com.persagy.common.model.BaseGroupModel;
@@ -159,6 +160,7 @@ public class SaasAccountController {
 		SaasAccount saasAccount = new SaasAccount();
 		BeanUtils.copyProperties(createVO, saasAccount);
 		saasAccount.setUpdateUser(createVO.getAccountId());
+		saasAccount.setTerminal(Sets.newHashSet(createVO.getAppId()));
 		saasAccount.setId(null);
 		if (StringUtil.isBlank(createVO.getPassword())) {
 			saasAccount.setPassword(this.properties.getDefaultPwd());
@@ -195,6 +197,7 @@ public class SaasAccountController {
 		SaasAccount saasAccount = new SaasAccount();
 		BeanUtils.copyProperties(createVO, saasAccount);
 		saasAccount.setId(createVO.getAccountId());
+		saasAccount.setTerminal(Sets.newHashSet(createVO.getAppId()));
 		saasAccount.setUpdateUser(createVO.getAccountId());
 		exists = this.saasAccountHandler.updateSaasAccount(saasAccount, createVO.getCasType(), createVO.getRoles());
 		return exists ? ResponseResultUtil.successResult("更新成功") : ResponseResultUtil.errorResult("更新失败");

+ 2 - 2
saas-account/src/main/java/com/persagy/person/controller/SaasLoginController.java

@@ -90,9 +90,9 @@ public class SaasLoginController {
     	if (SaasCommonConstant.STATUS_1 != account.getValid()) {
     		return ResponseResultUtil.errorResult(ResponseCode.A0220.getCode(), "此账号已停用");
 		}
-    	if (!account.getTerminal().contains(loginVO.getAppId())) {
+    	/*if (!account.getTerminal().contains(loginVO.getAppId())) {
     		return ResponseResultUtil.errorResult(ResponseCode.A0220.getCode(), "此账号不允许在此端登录");
-		}
+		}*/
     	// 验证是否在有效期内
     	if (SaasCommonConstant.STR_STATUS_0.equals(account.getValidLast())) {
     		Date date = new Date();

+ 5 - 0
saas-account/src/main/java/com/persagy/person/pojo/vo/account/SaasAccountCreateVO.java

@@ -2,6 +2,7 @@ package com.persagy.person.pojo.vo.account;
 
 import java.util.Date;
 import java.util.List;
+import java.util.Set;
 
 import javax.validation.constraints.NotBlank;
 
@@ -41,6 +42,10 @@ public class SaasAccountCreateVO {
 	@ApiModelProperty(value = "集团编码,作为SQL条件", required = true, example = "RC")
 	private String groupCode; 	// 所属集团编码
 	
+	//@NotBlank(message = "应用ID,不可为空")
+	@ApiModelProperty(value = "账号所属终端, PC-电脑端,APP-手机应用端", example = "PC", required = true)
+    private Set<String> terminal;	//后续若账号区分端的话,可以放弃appId,改为 terminal
+	
 	@NotBlank(message = "应用ID,不可为空")
 	@ApiModelProperty(value = "应用ID, PC-电脑端,APP-手机应用端", example = "PC", required = true)
     private String appId;