feat(app): 实现应用 Token 校验功能

- 服务端: fetchAllConfigs 和 fetchChangedConfigs 添加 Token 校验
- 前端: 应用列表添加 Token 列和生成/删除 Token 按钮
- 客户端: Python/Node.js/Java 客户端传递 token 参数
- Java: 简化 buildTokenParameter 直接传递 token 值
This commit is contained in:
2026-02-18 21:02:30 +08:00
parent 65c537b831
commit b011b3a0b3
7 changed files with 64 additions and 11 deletions
+2 -1
View File
@@ -62,7 +62,7 @@ export class ConfigClient {
}
async fetchAll() {
const url = `${this.config.baseUrl}/api/fetchAllConfigs?appName=${encodeURIComponent(this.config.appName)}&env=${encodeURIComponent(this.config.env)}&version=${encodeURIComponent(this.config.version)}&ignoreGlobal=${this.config.ignoreGlobal}`;
const url = `${this.config.baseUrl}/api/fetchAllConfigs?appName=${encodeURIComponent(this.config.appName)}&env=${encodeURIComponent(this.config.env)}&version=${encodeURIComponent(this.config.version)}&ignoreGlobal=${this.config.ignoreGlobal}&token=${encodeURIComponent(this.config.token)}`;
const resp = await fetch(url, {
headers: this.config.token ? { Authorization: `Bearer ${this.config.token}` } : {},
signal: AbortSignal.timeout(10000),
@@ -101,6 +101,7 @@ export class ConfigClient {
version: this.config.version,
lastTime: this.lastTime,
ignoreGlobal: this.config.ignoreGlobal,
token: this.config.token,
};
const resp = await fetch(url, {
method: 'POST',