WANG há 5 anos atrás
pai
commit
cededdf8dd

+ 13 - 0
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/bean/LoginInfo.java

@@ -62,6 +62,11 @@ public class LoginInfo implements JsonSerializable {
 	 */
 	private Boolean alwaysOK;
 
+	/**
+	 * 不创建会话
+	 */
+	private Boolean noSession;
+
 	public String getSessionId() {
 		return sessionId;
 	}
@@ -142,4 +147,12 @@ public class LoginInfo implements JsonSerializable {
 		this.imgCode = imgCode;
 	}
 
+	public Boolean getNoSession() {
+		return noSession;
+	}
+
+	public void setNoSession(Boolean noSession) {
+		this.noSession = noSession;
+	}
+
 }

+ 5 - 1
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

@@ -344,7 +344,11 @@ public class AuthServiceImpl implements AuthService {
 			}
 		}
 
-		setSession(user);
+		Boolean noSession = loginInfo.getNoSession();
+		if (null == noSession || !noSession) {
+			setSession(user);
+		}
+
 		setRolePrivilegesCache(user);
 
 		if (isLcUser) {