链接上数据库
This commit is contained in:
@@ -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 ?? '';
|
||||
|
||||
Reference in New Issue
Block a user