From 7c848452d426f2c9fdb1705dd303744850e18ea2 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 29 Aug 2025 11:26:30 +0800 Subject: [PATCH 1/2] perf: Disable the sqlbot-license-key verification mechanism --- frontend/src/utils/request.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) 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) => { }, }) } + */ From 814dbc33c3466453b0ea49ab4c6b01a3ec037b8c Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Fri, 29 Aug 2025 13:26:44 +0800 Subject: [PATCH 2/2] style: Page Embedding Style Optimization --- frontend/src/embedded.ts | 17 ---------- frontend/src/views/embedded/page.vue | 49 ++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 20 deletions(-) delete mode 100644 frontend/src/embedded.ts diff --git a/frontend/src/embedded.ts b/frontend/src/embedded.ts deleted file mode 100644 index f81e9fcb..00000000 --- a/frontend/src/embedded.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { createApp } from 'vue' -import { createPinia } from 'pinia' -import './style.less' -import App from './App.vue' -import router from './router' -import { i18n } from './i18n' -import VueDOMPurifyHTML from 'vue-dompurify-html' - -// import 'element-plus/dist/index.css' -const app = createApp(App) -const pinia = createPinia() - -app.use(pinia) -app.use(router) -app.use(i18n) -app.use(VueDOMPurifyHTML) -app.mount('#app') diff --git a/frontend/src/views/embedded/page.vue b/frontend/src/views/embedded/page.vue index 62418e76..7b39b5cf 100644 --- a/frontend/src/views/embedded/page.vue +++ b/frontend/src/views/embedded/page.vue @@ -1,20 +1,39 @@