diff --git a/src/api/api-analytics.ts b/src/api/api-analytics.ts index ec72160032038bbf42bd0920972d243e5eb4c92d..84e11b673409d68391db698b7865d6d82d606a55 100644 --- a/src/api/api-analytics.ts +++ b/src/api/api-analytics.ts @@ -3,5 +3,6 @@ import { request } from '@/shared/axios'; export function reportAnalytics(data: Record) { return request.post('/api-dsapi/query/track/openeuler', data, { $doException: true, + showLoading: false, }); } diff --git a/src/shared/axios/index.ts b/src/shared/axios/index.ts index 89c0f1d674ff3de3593a275a87e76dd81a8b928b..47136a80ae8f12e559cf9223bce3515a334a7d61 100644 --- a/src/shared/axios/index.ts +++ b/src/shared/axios/index.ts @@ -18,6 +18,7 @@ interface RequestConfig extends AxiosRequestConfig { data?: D; $doException?: boolean; // 是否弹出错误提示框 global?: boolean; // 是否为全局请求, 全局请求在清除请求池时,不清除 + showLoading?: boolean; // 是否显示loading,默认是 } interface ErrorResponse { msg: string; @@ -84,15 +85,18 @@ const pendingPool: Map = new Map(); */ const requestInterceptorId = request.interceptors.request.use( (config) => { - if (loadingCount === 0) { - loadingInstance = ElLoading.service({ - fullscreen: true, - target: 'body', - text: 'Loading', - background: 'transparent', - }); + if ((config as RequestConfig).showLoading !== false) { + if (loadingCount === 0) { + loadingInstance = ElLoading.service({ + fullscreen: true, + target: 'body', + text: 'Loading', + background: 'transparent', + }); + } + loadingCount++; } - loadingCount++; + // 存储请求信息 // 定义取消请求 config.cancelToken = new axios.CancelToken((cancelFn) => { @@ -119,12 +123,14 @@ const requestInterceptorId = request.interceptors.request.use( const responseInterceptorId = request.interceptors.response.use( // @ts-ignore (response: AxiosResponse) => { - loadingCount--; - if (loadingCount === 0 && loadingInstance) { - loadingInstance.close(); - loadingInstance = null; - } const { config } = response; + if ((config as RequestConfig).showLoading !== false) { + loadingCount--; + if (loadingCount === 0 && loadingInstance) { + loadingInstance.close(); + loadingInstance = null; + } + } // 请求完成,移除请求池 if (config.url) { pendingPool.delete(config.url); diff --git a/src/views/submit-issue/SubmitIssue.vue b/src/views/submit-issue/SubmitIssue.vue index 0a0867fb1e24d929cacabe53ea9d52cbf7655f41..a3a3cca3d067f297340d69d7efee96454819c030 100644 --- a/src/views/submit-issue/SubmitIssue.vue +++ b/src/views/submit-issue/SubmitIssue.vue @@ -219,7 +219,11 @@ async function goGitee(verify: FormInstance | undefined) { rules.privacy = []; verify.validate(async (res: boolean) => { if (res) { - const url = `${giteeUrl}/${issueData.repo}/issues/new?title=${issueData.title}&issue%5Bissue_type_id%5D=${issueTypeId.value}`; + const url = `${giteeUrl}/${issueData.repo}/issues/new?title=${ + issueData.title + }&issue%5Bissue_type_id%5D=${ + issueTypeId.value + }&issue%5Bdescription%5D=${encodeURIComponent(issueData.description)}`; oaReport('toGiteeCreateIssue', { $utm_source: 'quick_issue', jump_url: url, @@ -366,7 +370,7 @@ onMounted(async () => { await getIssueSelectOption('types', null).then((res) => { // 手动筛选,只留两个场景 【开发|使用openEuler】 const sceneDescMap: Record = { - '开发openEuler': '如构建场景/测试场景/发布场景/分析场景/问题反馈场景/其他场景', + '开发openEuler': '如构建场景/测试场景/发布场景/分析场景/其他场景', '使用openEuler': '如下载场景/使用文档场景/安装及迁移场景/其他场景', }; typesList.value = res.data @@ -413,7 +417,11 @@ watch( :class="lang === 'en' ? 'en-form' : ''" >
- + {{ t('quickIssue.YES') }} {{ t('quickIssue.NO') }} @@ -482,6 +490,7 @@ watch( @@ -517,7 +526,7 @@ watch(
-
+