mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-07 15:14:23 +08:00
feat: API Key 模块新增 namespace 命名空间,为多账号模式提供支持
This commit is contained in:
@@ -24,7 +24,7 @@ public class SaApiKeyDataLoaderImpl implements SaApiKeyDataLoader {
|
||||
|
||||
// 根据 apiKey 从数据库获取 ApiKeyModel 信息 (实现此方法无需为数据做缓存处理,框架内部已包含缓存逻辑)
|
||||
@Override
|
||||
public ApiKeyModel getApiKeyModelFromDatabase(String apiKey) {
|
||||
public ApiKeyModel getApiKeyModelFromDatabase(String namespace, String apiKey) {
|
||||
return apiKeyMockMapper.getApiKeyModel(apiKey);
|
||||
}
|
||||
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.pj.mock;
|
||||
|
||||
import cn.dev33.satoken.apikey.model.ApiKeyModel;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -12,7 +12,7 @@ import java.util.Map;
|
||||
* @author click33
|
||||
* @since 2025/4/4
|
||||
*/
|
||||
@Service
|
||||
@Component
|
||||
public class SaApiKeyMockMapper {
|
||||
|
||||
// 添加模拟测试数据
|
||||
|
@@ -11,5 +11,5 @@ public class SaTokenJwtDemoApplication {
|
||||
SpringApplication.run(SaTokenJwtDemoApplication.class, args);
|
||||
System.out.println("\n启动成功:Sa-Token配置如下:" + SaManager.getConfig());
|
||||
}
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user