diff --git a/src/api/api-quick-issue.ts b/src/api/api-quick-issue.ts index d5835f6536545b93a446f30a2ebabb11a3c1c460..1b5c695577457f579e8932800dbc1d7d0a37cc31 100644 --- a/src/api/api-quick-issue.ts +++ b/src/api/api-quick-issue.ts @@ -3,6 +3,14 @@ import type { AxiosResponse } from '@/shared/axios'; import { IssueQueryData } from '@/shared/@types/type-quick-issue'; import { getAuthorization } from '@/shared/utils'; +function getHeaderConfig() { + const headersConfig = { + headers: { + authorization: getAuthorization(), + }, + }; + return headersConfig; +} /** * 获取issue 数据 * @name getRepoIssue @@ -74,7 +82,7 @@ export function verifySubmitterEmail(params: object) { const url = '/api-issues/verify/'; return request - .post(url, params) + .post(url, params, getHeaderConfig()) .then((res: AxiosResponse) => res?.data) .catch((e: any) => { console.error(e); @@ -102,7 +110,7 @@ export function getReposData(params: object) { export function createIssue(params: object) { const url = `/api-issues/new-issue/`; return request - .post(url, params) + .post(url, params, getHeaderConfig()) .then((res: AxiosResponse) => res?.data) .catch((e: any) => { console.error(e); @@ -176,4 +184,4 @@ export function getPrSelectOption(type: string, params: object | null) { .catch((e: any) => { console.error(e); }); -} +} \ No newline at end of file