Skip to content

Commit 7c84845

Browse files
perf: Disable the sqlbot-license-key verification mechanism
1 parent 8747fb7 commit 7c84845

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

frontend/src/utils/request.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import axios, {
1111
import { useCache } from '@/utils/useCache'
1212
import { getLocale } from './utils'
1313
import { useAssistantStore } from '@/stores/assistant'
14-
import { i18n } from '@/i18n'
15-
const t = i18n.global.t
14+
// import { i18n } from '@/i18n'
15+
// const t = i18n.global.t
1616
const assistantStore = useAssistantStore()
1717
const { wsCache } = useCache()
1818
// Response data structure
@@ -65,10 +65,10 @@ class HttpService {
6565
this.setupInterceptors()
6666
}
6767

68-
private cancelCurrentRequest(message: string) {
68+
/* private cancelCurrentRequest(message: string) {
6969
this.cancelTokenSource.cancel(message)
7070
this.cancelTokenSource = axios.CancelToken.source()
71-
}
71+
} */
7272

7373
private setupInterceptors() {
7474
// Request interceptor
@@ -112,15 +112,15 @@ class HttpService {
112112
return config
113113
}
114114

115-
try {
115+
/* try {
116116
const request_key = LicenseGenerator.generate()
117117
config.headers['X-SQLBOT-KEY'] = request_key
118118
} catch (e: any) {
119119
if (e?.message?.includes('offline')) {
120120
this.cancelCurrentRequest('license-key error detected')
121121
showLicenseKeyError()
122122
}
123-
}
123+
} */
124124

125125
// Request logging
126126
// console.log(`[Request] ${config.method?.toUpperCase()} ${config.url}`)
@@ -293,15 +293,15 @@ class HttpService {
293293
}
294294
}
295295

296-
try {
296+
/* try {
297297
const request_key = LicenseGenerator.generate()
298298
heads['X-SQLBOT-KEY'] = request_key
299299
} catch (e: any) {
300300
if (e?.message?.includes('offline')) {
301301
controller?.abort('license-key error detected')
302302
showLicenseKeyError()
303303
}
304-
}
304+
} */
305305

306306
const real_url = import.meta.env.VITE_API_BASE_URL
307307
return fetch(real_url + url, {
@@ -422,7 +422,7 @@ class HttpService {
422422
export const request = new HttpService({
423423
baseURL: import.meta.env.VITE_API_BASE_URL,
424424
})
425-
425+
/*
426426
const showLicenseKeyError = (msg?: string) => {
427427
ElMessageBox.confirm(t('license.error_tips'), {
428428
confirmButtonType: 'primary',
@@ -438,3 +438,4 @@ const showLicenseKeyError = (msg?: string) => {
438438
},
439439
})
440440
}
441+
*/

0 commit comments

Comments
 (0)