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;