mirror of
https://github.com/tangledup-ai/stepfun-vector-stores-admin.git
synced 2026-01-20 19:00:59 +08:00
fix(vite): 使用代理,以解决跨域问题
This commit is contained in:
@@ -1,3 +1,2 @@
|
||||
VITE_CLERK_PUBLISHABLE_KEY=
|
||||
VITE_STEPFUN_ENDPOINT=
|
||||
VITE_STEPFUN_ENDPOINT=/proxy
|
||||
VITE_STEPFUN_API_KEY=
|
||||
@@ -4,7 +4,6 @@ import react from '@vitejs/plugin-react-swc'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import { tanstackRouter } from '@tanstack/router-plugin/vite'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tanstackRouter({
|
||||
@@ -19,4 +18,13 @@ export default defineConfig({
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
server: {
|
||||
proxy: {
|
||||
'/proxy': {
|
||||
target: 'https://api.stepfun.com/v1',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/proxy/, ''),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user