Explorar el Código

'权限控制更新'

hotwind hace 7 años
padre
commit
8863face0a

+ 2 - 2
zen-api/src/main/kotlin/com/gxzc/zen/umps/config/KissoAuthorization.kt

@@ -19,11 +19,11 @@ class KissoAuthorization : SSOAuthorization {
             return false
         }
 
-        if (!StringUtils.isNumeric(token.id.toString())) {
+        if (!StringUtils.isNumeric(token.uid.toString())) {
             return false
         }
         val realPerm = "${PlatformUtil.getPlatformId()}:$permission"
-        return PermissionUtil.isPermitted(realPerm, permissionService.getPermissionSetByUserId(token.id as Long))
+        return PermissionUtil.isPermitted(realPerm, permissionService.getPermissionSetByUserId(token.uid.toLong()))
     }
 
     //    private val cacheManager = SpringContextHolder.getBean(CacheManager::class.java)

+ 19 - 0
zen-web/src/main/kotlin/com/gxzc/zen/web/sys/controller/TestController.kt

@@ -2,6 +2,7 @@ package com.gxzc.zen.web.sys.controller
 
 import com.baomidou.kisso.annotation.Action
 import com.baomidou.kisso.annotation.Login
+import com.baomidou.kisso.annotation.Permission
 import com.baomidou.mybatisplus.mapper.EntityWrapper
 import com.gxzc.zen.api.sys.mapper.SysDicMapper
 import com.gxzc.zen.api.sys.model.SysDic
@@ -123,4 +124,22 @@ class TestController : BaseController() {
 
         throw RuntimeException()
     }
+
+    @GetMapping("/testpermission")
+    @Permission("backup:crud")
+    fun testpermission() {
+
+    }
+
+    @GetMapping("/testpermission1")
+    @Permission("backup:c")
+    fun testpermission1() {
+
+    }
+
+    @GetMapping("/testpermission2")
+    @Permission("backup2:c")
+    fun testpermission2() {
+
+    }
 }

+ 1 - 1
zen-web/src/main/resources/application-job.yml

@@ -1,6 +1,6 @@
 xxl:
   job:
-    enable: true
+    enable: false
     admin:
       address: http://127.0.0.1:8080
     executor:

+ 1 - 1
zen-web/src/main/resources/application-orm.yml

@@ -1,5 +1,5 @@
 orm:
-  multi-datasource-enable: false # 多数据源开关
+  multi-datasource-enable: true # 多数据源开关