链接上数据库

This commit is contained in:
2026-02-27 12:02:15 +08:00
parent d3872250dd
commit ab0a5c53f7
5 changed files with 577 additions and 144 deletions

View File

@@ -118,7 +118,8 @@ export class AkReq {
// 统一 header自动带上 Authorization/Content-Type/Accept
let headers = options.headers ?? ({} as UTSJSONObject);
const token = this.getToken();
if (token != null && token != "") {
const existAuth = headers['Authorization'] ?? headers['authorization'];
if ((token != null && token != "") && (existAuth == null)) {
headers = Object.assign({}, headers, { Authorization: `Bearer ${token}` }) as UTSJSONObject;
}
let contentType = options.contentType ?? '';