mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-10-18 09:25:03 +00:00
fix: 手动打包 Proxy 问题(#91)
* perf: 检查代码 * feat: proxy setting * chore: 调整为测试环境使用 `proxy`
This commit is contained in:
2
src/typings/env.d.ts
vendored
2
src/typings/env.d.ts
vendored
@@ -3,5 +3,5 @@
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_GLOB_API_URL: string;
|
||||
readonly VITE_GLOB_API_TIMEOUT: string;
|
||||
readonly VITE_APP_API_BASE_URL: string;
|
||||
readonly VITE_GLOB_HTTP_PROXY: 'Y' | 'N';
|
||||
}
|
||||
|
@@ -1,8 +1,6 @@
|
||||
function includeCode(text: string | null | undefined) {
|
||||
const regexp = /^(?:\s{4}|\t).+/gm
|
||||
if (text?.includes(' = ') || text?.match(regexp))
|
||||
return true
|
||||
return false
|
||||
return !!(text?.includes(' = ') || text?.match(regexp))
|
||||
}
|
||||
|
||||
export default includeCode
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import axios, { type AxiosResponse } from 'axios'
|
||||
|
||||
const service = axios.create({
|
||||
baseURL: import.meta.env.VITE_GLOB_API_URL,
|
||||
baseURL: import.meta.env.VITE_GLOB_HTTP_PROXY === 'Y' ? '/api' : import.meta.env.VITE_GLOB_API_URL,
|
||||
timeout: !isNaN(+import.meta.env.VITE_GLOB_API_TIMEOUT) ? Number(import.meta.env.VITE_GLOB_API_TIMEOUT) : 60 * 1000,
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user