Explorar o código

查询管理员工具类修改

dedsudiyu hai 1 semana
pai
achega
e2c2bcd50d
Modificáronse 1 ficheiros con 19 adicións e 8 borrados
  1. 19 8
      utils/index.js

+ 19 - 8
utils/index.js

@@ -35,16 +35,27 @@ export function itoOrVideoLimits(subAdminId) {
   let userInfo = uni.getStorageSync('user');
   let schoolId = config.schoolId;
   let collegeId = config.collegeId;
-  if(userInfo.position == null){
-    //如果是管理员(系统用户)
+  // if(userInfo.position == null){
+  //   //如果是管理员(系统用户)
+  //   return true
+  // }else if(userInfo.position == schoolId || userInfo.position == collegeId){
+  //   //如果是校级管理员/院级管理员
+  //   return true
+  // }else if(userInfo.userId == subAdminId){
+  //   //如果当前用户userId 与 管理员ID相等
+  //   return true
+  // }else{
+  //   return false
+  // }
+	if(userInfo.position == null){
+		//如果是管理员(系统用户)
     return true
-  }else if(userInfo.position == schoolId || userInfo.position == collegeId){
-    //如果是校级管理员/院级管理员
+	}else if(userInfo.position == schoolId || userInfo.position == collegeId){
+		//如果是校级管理员/院级管理员
     return true
-  }else if(userInfo.userId == subAdminId){
-    //如果当前用户userId 与 管理员ID相等
+  }else if(uni.getStorageSync('subAdmin') == 1){
     return true
-  }else{
+	}else{
     return false
-  }
+	}
 }