mirror of
				https://github.com/YunaiV/ruoyi-vue-pro.git
				synced 2025-10-31 18:49:06 +08:00 
			
		
		
		
	修复ContextHolder的NPE异常
This commit is contained in:
		| @ -539,11 +539,11 @@ public class DataPermissionDatabaseInterceptor extends JsqlParserSupport impleme | |||||||
|         /** |         /** | ||||||
|          * 该 {@link MappedStatement} 对应的规则 |          * 该 {@link MappedStatement} 对应的规则 | ||||||
|          */ |          */ | ||||||
|         private static final ThreadLocal<List<DataPermissionRule>> RULES = new TransmittableThreadLocal<>(); |         private static final ThreadLocal<List<DataPermissionRule>> RULES = ThreadLocal.withInitial(Collections::emptyList); | ||||||
|         /** |         /** | ||||||
|          * SQL 是否进行重写 |          * SQL 是否进行重写 | ||||||
|          */ |          */ | ||||||
|         private static final ThreadLocal<Boolean> REWRITE = new TransmittableThreadLocal<>(); |         private static final ThreadLocal<Boolean> REWRITE = ThreadLocal.withInitial(() -> Boolean.FALSE); | ||||||
|  |  | ||||||
|         public static void init(List<DataPermissionRule> rules) { |         public static void init(List<DataPermissionRule> rules) { | ||||||
|             RULES.set(rules); |             RULES.set(rules); | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 Xuing
					Xuing