From c38741aa05266398d64bf3ffd4ce3333dee90441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Thu, 13 Mar 2025 15:17:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cool/service/request.ts | 2 +- src/plugins/upload/hooks/index.ts | 4 ++-- src/plugins/upload/types/index.d.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cool/service/request.ts b/src/cool/service/request.ts index 355891f..51b16d5 100644 --- a/src/cool/service/request.ts +++ b/src/cool/service/request.ts @@ -53,7 +53,7 @@ request.interceptors.request.use( } // 设置请求头中的语言 - if (!req.headers['language'] !== null) { + if (req.headers['language'] !== null) { req.headers['language'] = config.i18n.locale; } diff --git a/src/plugins/upload/hooks/index.ts b/src/plugins/upload/hooks/index.ts index 6199129..d3f0ab9 100644 --- a/src/plugins/upload/hooks/index.ts +++ b/src/plugins/upload/hooks/index.ts @@ -13,7 +13,7 @@ export function useUpload() { const { t } = useI18n(); // 上传 - async function toUpload(file: File, opts: Upload.Options = {}): Upload.Respose { + async function toUpload(file: File, opts: Upload.Options = {}): Upload.Response { return new Promise((resolve, reject) => { const executor = async () => { // 合并配置 @@ -110,7 +110,7 @@ export function useUpload() { if (isLocal) { next({ - host: '/admin/base/comm/upload' + host: 'admin/base/comm/upload' }); } else { service.base.comm diff --git a/src/plugins/upload/types/index.d.ts b/src/plugins/upload/types/index.d.ts index e4cc6b6..b65806e 100644 --- a/src/plugins/upload/types/index.d.ts +++ b/src/plugins/upload/types/index.d.ts @@ -22,7 +22,7 @@ declare namespace Upload { [key: string]: any; } - type Respose = Promise<{ + type Response = Promise<{ key: string; url: string; fileId: string;