Browse Source

Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue

 Conflicts:
	ruoyi-ui/src/utils/permission.js
	ruoyi-ui/src/utils/request.js
疯狂的狮子li 4 years ago
parent
commit
476df3117b
2 changed files with 6 additions and 4 deletions
  1. 5 3
      ruoyi-ui/src/utils/permission.js
  2. 1 1
      ruoyi-ui/src/utils/request.js

+ 5 - 3
ruoyi-ui/src/utils/permission.js

@@ -9,9 +9,10 @@ export function checkPermi(value) {
   if (value && value instanceof Array && value.length > 0) {
     const permissions = store.getters && store.getters.permissions
     const permissionDatas = value
+    const all_permission = "*:*:*";
 
     const hasPermission = permissions.some(permission => {
-      return permissionDatas.includes(permission)
+      return all_permission === permission || permissionDatas.includes(permission)
     })
 
     if (!hasPermission) {
@@ -33,9 +34,10 @@ export function checkRole(value) {
   if (value && value instanceof Array && value.length > 0) {
     const roles = store.getters && store.getters.roles
     const permissionRoles = value
+    const super_admin = "admin";
 
     const hasRole = roles.some(role => {
-      return permissionRoles.includes(role)
+      return super_admin === role || permissionRoles.includes(role)
     })
 
     if (!hasRole) {
@@ -46,4 +48,4 @@ export function checkRole(value) {
     console.error(`need roles! Like checkRole="['admin','editor']"`)
     return false
   }
-}
+}

+ 1 - 1
ruoyi-ui/src/utils/request.js

@@ -25,7 +25,7 @@ service.interceptors.request.use(config => {
     for (const propName of Object.keys(config.params)) {
       const value = config.params[propName];
       var part = encodeURIComponent(propName) + "=";
-      if (value && typeof(value) !== "undefined") {
+      if (value !== null && typeof(value) !== "undefined") {
         if (typeof value === 'object') {
           for (const key of Object.keys(value)) {
             let params = propName + '[' + key + ']';