Authored by zhaoyue

MOD add role_id limit

@@ -2,7 +2,7 @@ git pull @@ -2,7 +2,7 @@ git pull
2 git add --all src/main/java/* 2 git add --all src/main/java/*
3 git add push.sh 3 git add push.sh
4 git add pom.xml 4 git add pom.xml
5 -git commit -m "MOD verify url" 5 +git commit -m "MOD add role_id limit"
6 #git push origin master 6 #git push origin master
7 git push origin zhaoyue-dev4 7 git push origin zhaoyue-dev4
8 git status 8 git status
@@ -24,10 +24,13 @@ public class XklAdminEntity { @@ -24,10 +24,13 @@ public class XklAdminEntity {
24 @Column(name = "pwd") 24 @Column(name = "pwd")
25 private String pwd; 25 private String pwd;
26 26
27 - //账号类型 27 + //角色
28 @Column(name = "type") 28 @Column(name = "type")
29 private int type; 29 private int type;
30 30
  31 + //账号类型
  32 + @Column(name = "role_id")
  33 + private int roleId;
31 34
32 //公司id 35 //公司id
33 @Column(name = "coid") 36 @Column(name = "coid")
@@ -78,6 +81,14 @@ public class XklAdminEntity { @@ -78,6 +81,14 @@ public class XklAdminEntity {
78 this.type = type; 81 this.type = type;
79 } 82 }
80 83
  84 + public int getRoleId() {
  85 + return roleId;
  86 + }
  87 +
  88 + public void setRoleId(int roleId) {
  89 + this.roleId = roleId;
  90 + }
  91 +
81 public int getCoid() { 92 public int getCoid() {
82 return coid; 93 return coid;
83 } 94 }
@@ -43,7 +43,8 @@ public class LoginServiceImpl implements ILoginService{ @@ -43,7 +43,8 @@ public class LoginServiceImpl implements ILoginService{
43 @Override 43 @Override
44 public XklAdminEntity checkAdmin(String username, String password) { 44 public XklAdminEntity checkAdmin(String username, String password) {
45 XklAdminEntity admin = adminRepository.findByAccountAndStatus(username, Constants.STATUS_OK); 45 XklAdminEntity admin = adminRepository.findByAccountAndStatus(username, Constants.STATUS_OK);
46 - if(admin == null){ 46 + // 只有 普通区域管理员5,直辖区域管理员6;普通区域操作员7,直辖区域操作员8 才能使用接口登录操作上传软件。
  47 + if (admin == null || admin.getRoleId() < 5 || admin.getRoleId() > 8) {
47 return null; 48 return null;
48 }else{ 49 }else{
49 String salt = admin.getSalt(); 50 String salt = admin.getSalt();