Authored by zhaoyue

MOD add role_id limit

... ... @@ -2,7 +2,7 @@ git pull
git add --all src/main/java/*
git add push.sh
git add pom.xml
git commit -m "MOD verify url"
git commit -m "MOD add role_id limit"
#git push origin master
git push origin zhaoyue-dev4
git status
... ...
... ... @@ -24,10 +24,13 @@ public class XklAdminEntity {
@Column(name = "pwd")
private String pwd;
//账号类型
//角色
@Column(name = "type")
private int type;
//账号类型
@Column(name = "role_id")
private int roleId;
//公司id
@Column(name = "coid")
... ... @@ -78,6 +81,14 @@ public class XklAdminEntity {
this.type = type;
}
public int getRoleId() {
return roleId;
}
public void setRoleId(int roleId) {
this.roleId = roleId;
}
public int getCoid() {
return coid;
}
... ...
... ... @@ -43,7 +43,8 @@ public class LoginServiceImpl implements ILoginService{
@Override
public XklAdminEntity checkAdmin(String username, String password) {
XklAdminEntity admin = adminRepository.findByAccountAndStatus(username, Constants.STATUS_OK);
if(admin == null){
// 只有 普通区域管理员5,直辖区域管理员6;普通区域操作员7,直辖区域操作员8 才能使用接口登录操作上传软件。
if (admin == null || admin.getRoleId() < 5 || admin.getRoleId() > 8) {
return null;
}else{
String salt = admin.getSalt();
... ...