diff --git a/frontend/src/utils/request.ts b/frontend/src/utils/request.ts index 6635f421..f222fae5 100644 --- a/frontend/src/utils/request.ts +++ b/frontend/src/utils/request.ts @@ -11,8 +11,8 @@ import axios, { import { useCache } from '@/utils/useCache' import { getLocale } from './utils' import { useAssistantStore } from '@/stores/assistant' -import { i18n } from '@/i18n' -const t = i18n.global.t +// import { i18n } from '@/i18n' +// const t = i18n.global.t const assistantStore = useAssistantStore() const { wsCache } = useCache() // Response data structure @@ -65,10 +65,10 @@ class HttpService { this.setupInterceptors() } - private cancelCurrentRequest(message: string) { + /* private cancelCurrentRequest(message: string) { this.cancelTokenSource.cancel(message) this.cancelTokenSource = axios.CancelToken.source() - } + } */ private setupInterceptors() { // Request interceptor @@ -112,7 +112,7 @@ class HttpService { return config } - try { + /* try { const request_key = LicenseGenerator.generate() config.headers['X-SQLBOT-KEY'] = request_key } catch (e: any) { @@ -120,7 +120,7 @@ class HttpService { this.cancelCurrentRequest('license-key error detected') showLicenseKeyError() } - } + } */ // Request logging // console.log(`[Request] ${config.method?.toUpperCase()} ${config.url}`) @@ -293,7 +293,7 @@ class HttpService { } } - try { + /* try { const request_key = LicenseGenerator.generate() heads['X-SQLBOT-KEY'] = request_key } catch (e: any) { @@ -301,7 +301,7 @@ class HttpService { controller?.abort('license-key error detected') showLicenseKeyError() } - } + } */ const real_url = import.meta.env.VITE_API_BASE_URL return fetch(real_url + url, { @@ -422,7 +422,7 @@ class HttpService { export const request = new HttpService({ baseURL: import.meta.env.VITE_API_BASE_URL, }) - +/* const showLicenseKeyError = (msg?: string) => { ElMessageBox.confirm(t('license.error_tips'), { confirmButtonType: 'primary', @@ -438,3 +438,4 @@ const showLicenseKeyError = (msg?: string) => { }, }) } + */