浏览代码

Merge remote-tracking branch 'remotes/origin/dev_1.0.0' into release_1.0.0

xiatian 2 年之前
父节点
当前提交
4ea9a653dd

+ 76 - 64
src/main/java/cn/com/qmth/mps/bean/User.java

@@ -4,92 +4,104 @@ import com.qmth.boot.core.security.model.AccessEntity;
 
 import cn.com.qmth.mps.enums.Role;
 
-public class User implements AccessEntity{
+public class User implements AccessEntity {
 
-    private Long id;
+	private Long id;
 
-    private String name;
+	private String name;
+	private String loginName;
+	private String sessionId;
 
-    private String sessionId;
+	private String accessToken;
 
-    private String accessToken;
+	private Role role;
 
-    private Role role;
+	private Long activeTime;
 
-    private Long activeTime;
+	private Long schoolId;
 
-    private Long schoolId;
-    
-    public String buildKey() {
-        this.sessionId = new StringBuilder().append(role.name()).append("_").append(id).toString();
-        return this.sessionId;
-    }
+	public String buildKey() {
+		this.sessionId = new StringBuilder().append(role.name()).append("_").append(id).toString();
+		return this.sessionId;
+	}
 
+	public String getName() {
+		return name;
+	}
 
-    public String getName() {
-        return name;
-    }
+	public void setName(String name) {
+		this.name = name;
+	}
 
-    public void setName(String name) {
-        this.name = name;
-    }
+	public String getSessionId() {
+		return sessionId;
+	}
 
-    public String getSessionId() {
-        return sessionId;
-    }
+	public void setSessionId(String sessionId) {
+		this.sessionId = sessionId;
+	}
 
-    public void setSessionId(String sessionId) {
-        this.sessionId = sessionId;
-    }
+	public String getAccessToken() {
+		return accessToken;
+	}
 
-    public String getAccessToken() {
-        return accessToken;
-    }
+	public void setAccessToken(String accessToken) {
+		this.accessToken = accessToken;
+	}
 
-    public void setAccessToken(String accessToken) {
-        this.accessToken = accessToken;
-    }
+	public Role getRole() {
+		return role;
+	}
 
-    public Role getRole() {
-        return role;
-    }
+	public void setRole(Role role) {
+		this.role = role;
+	}
 
-    public void setRole(Role role) {
-        this.role = role;
-    }
+	public Long getActiveTime() {
+		return activeTime;
+	}
 
-    public Long getActiveTime() {
-        return activeTime;
-    }
+	public void setActiveTime(Long activeTime) {
+		this.activeTime = activeTime;
+	}
 
-    public void setActiveTime(Long activeTime) {
-        this.activeTime = activeTime;
-    }
+	public Long getId() {
+		return id;
+	}
 
-    public Long getId() {
-        return id;
-    }
+	public void setId(Long id) {
+		this.id = id;
+	}
 
-    public void setId(Long id) {
-        this.id = id;
-    }
+	public Long getSchoolId() {
+		return schoolId;
+	}
 
-    public Long getSchoolId() {
-        return schoolId;
-    }
+	public void setSchoolId(Long schoolId) {
+		this.schoolId = schoolId;
+	}
 
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-    @Override
-    public String getIdentity() {
-        return sessionId;
-    }
+	@Override
+	public String getIdentity() {
+		return sessionId;
+	}
 
-    @Override
-    public String getSecret() {
-        return accessToken;
-    }
+	@Override
+	public String getSecret() {
+		return accessToken;
+	}
+
+	public String getLoginName() {
+		return loginName;
+	}
+
+	public void setLoginName(String loginName) {
+		this.loginName = loginName;
+	}
+
+	@Override
+	public String getLogName() {
+		return schoolId + "_" + loginName + "_" + role;
+	}
 
-    
 }

+ 4 - 0
src/main/java/cn/com/qmth/mps/service/impl/AuthServiceImpl.java

@@ -83,6 +83,7 @@ public class AuthServiceImpl implements AuthorizationService<User>, AuthService
 			throw new StatusException("该学校已禁用");
 		}
 		User user = new User();
+		user.setLoginName(userEntity.getLoginName());
 		user.setName(userEntity.getName());
 		user.setSchoolId(userEntity.getSchoolId());
 		user.setId(userEntity.getId());
@@ -122,6 +123,7 @@ public class AuthServiceImpl implements AuthorizationService<User>, AuthService
 			throw new StatusException("密码错误");
 		}
 		User user = new User();
+		user.setLoginName(userEntity.getLoginName());
 		user.setName(userEntity.getName());
 		user.setSchoolId(userEntity.getSchoolId());
 		user.setId(userEntity.getId());
@@ -222,6 +224,7 @@ public class AuthServiceImpl implements AuthorizationService<User>, AuthService
 		wi.setPhone(phone);
 		wxappInfoService.saveOrUpdate(wi);
 		User user = new User();
+		user.setLoginName(userEntity.getLoginName());
 		user.setName(userEntity.getName());
 		user.setSchoolId(userEntity.getSchoolId());
 		user.setId(userEntity.getId());
@@ -312,6 +315,7 @@ public class AuthServiceImpl implements AuthorizationService<User>, AuthService
 		wi.setPhone(phone);
 		wxappInfoService.saveOrUpdate(wi);
 		User user = new User();
+		user.setLoginName(userEntity.getLoginName());
 		user.setName(userEntity.getName());
 		user.setSchoolId(userEntity.getSchoolId());
 		user.setId(userEntity.getId());