我想针对新建的一张表按city_code来做权限控制,感谢翼总或则其他大佬解答:
问题1: 自定义配置里使用${cityCode}, cityCode是否需要在TokenUtil.createAuthInfo方法中返回?
问题2:按照blade参照文档,数据权限配置没生效,步骤如下
一、该问题的重现步骤是什么?
1.
2.用户角色赋权
3.
二、你期待的结果是什么?实际看到的又是什么?
期待自定义的成是能通过数据权限控制。
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
blade-boot:2.7.2
saber: 2.7.0
四、请提供详细的错误堆栈信息,这很重要。
页面查询并未生效,日志也没带上自定义的内容:
================ Request Start ================
===> GET: /tables/suma/list Parameters: {"sumA":{"id":null,"acctMonth":null,"cityCode":null,"updateTime":null,"remark":null,"staffId":null},"query":{"current":1,"size":10,"ascs":null,"descs":null}}
===Headers=== sec-fetch-mode: cors
===Headers=== referer: http://localhost:3005/tables/suma
===Headers=== sec-fetch-site: same-origin
===Headers=== blade-auth: bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpc3MiOiJpc3N1c2VyIiwiYXVkIjoiYXVkaWVuY2UiLCJ0ZW5hbnRfaWQiOiIwMDAwMDAiLCJyb2xlX25hbWUiOiJ1c2VyLGhyLG1hbmFnZXIsYm9zcyIsInBvc3RfaWQiOiIxMTIzNTk4ODE3NzM4Njc1MjA4IiwidXNlcl9pZCI6IjE0MjgwMDQ5MDU1MTY5OTQ1NjIiLCJyb2xlX2lkIjoiMTEyMzU5ODgxNjczODY3NTIwMiwxMTIzNTk4ODE2NzM4Njc1MjAzLDExMjM1OTg4MTY3Mzg2NzUyMDQsMTEyMzU5ODgxNjczODY3NTIwNSIsInVzZXJfbmFtZSI6IndoIiwibmlja19uYW1lIjoid2giLCJkZXRhaWwiOnsidHlwZSI6IndlYiJ9LCJ0b2tlbl90eXBlIjoiYWNjZXNzX3Rva2VuIiwiZGVwdF9pZCI6IjE0MDgzNTM1ODU3MTI1MzM1MDUiLCJhY2NvdW50Ijoid2giLCJjbGllbnRfaWQiOiJzYWJ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ZXIiLCJleHAiOjE2Mjk5MDY3MjQsIm5iZiI6MTYyOTMwMTkyNH0.xGyjsdAQCo1yfEe0f52QYAMKnUJU7J2Ei8S80AB_9VPKI3nyySSEyMmJepAwkvDKqtFYUhRjhjXXwOn8DIoOpA
===Headers=== accept-language: zh-CN,zh;q=0.9,en;q=0.8
===Headers=== x-forwarded-proto: http
===Headers=== x-forwarded-port: 3005
===Headers=== x-forwarded-for: 127.0.0.1
===Headers=== accept: application/json, text/plain, */*
===Headers=== authorization: Basic c2FiZXI6c2FiZXJfc2VjcmV0
===Headers=== sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"
===Headers=== sec-ch-ua-mobile: ?0
===Headers=== x-forwarded-host: localhost:3005
===Headers=== host: localhost:8800
===Headers=== connection: close
===Headers=== accept-encoding: gzip, deflate, br
===Headers=== user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
===Headers=== sec-fetch-dest: empty
================ Request End ================
2021-08-18 23:52:13.355 DEBUG 19528 --- [XNIO-1 task-217] o.s.core.tenant.BladeTenantInterceptor : original SQL: SELECT id,acct_month,city_code,update_time,remark,staff_id FROM mi_sum_a
2021-08-18 23:52:13.355 DEBUG 19528 --- [XNIO-1 task-217] o.s.core.tenant.BladeTenantInterceptor : SQL to parse, SQL: SELECT id,acct_month,city_code,update_time,remark,staff_id FROM mi_sum_a
五、若有更多详细信息,请在下面提供。
扫一扫访问 Blade技术社区 移动端