新增管理师移动端前端模块
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import path from 'node:path'
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '')
|
||||
const proxyTarget = String(env.VITE_DEV_PROXY_TARGET || 'http://127.0.0.1:80').trim()
|
||||
const proxyToCoreDirectly = /(^|:)81(\/|$)/.test(proxyTarget)
|
||||
|
||||
return {
|
||||
base: '/fm-front/',
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src')
|
||||
}
|
||||
},
|
||||
server: {
|
||||
port: 3001,
|
||||
host: true,
|
||||
proxy: {
|
||||
'/admin/api': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
rewrite: targetPath => proxyToCoreDirectly ? targetPath.replace(/^\/admin\/api/, '/admin') : targetPath
|
||||
},
|
||||
'/api': {
|
||||
target: proxyTarget,
|
||||
changeOrigin: true,
|
||||
rewrite: targetPath => proxyToCoreDirectly ? targetPath.replace(/^\/api/, '') : targetPath
|
||||
}
|
||||
},
|
||||
allowedHosts: ['localhost', '127.0.0.1', '2666.online', 'wcy111.top']
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user