员工权限完善
This commit is contained in:
@@ -40,6 +40,16 @@ public class MyStpLogic {
|
||||
return ADMIN_LOGIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验员工权限
|
||||
* @param code 权限码
|
||||
*/
|
||||
public void checkStaffPermission(String code) {
|
||||
if (this.isStaff()) {
|
||||
StpKit.USER.checkPermission(code);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id 登录账号id
|
||||
* @param shopId 店铺id
|
||||
@@ -152,6 +162,10 @@ public class MyStpLogic {
|
||||
*/
|
||||
public boolean isStaff() {
|
||||
StpLogic logic = getLogic();
|
||||
Object loginIdDefaultNull = logic.getLoginIdDefaultNull();
|
||||
if (loginIdDefaultNull == null) {
|
||||
return false;
|
||||
}
|
||||
Object object = logic.getSession().get("loginType");
|
||||
return object instanceof LoginType t && t.equals(LoginType.STAFF);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user