feat:修改地址配置

This commit is contained in:
bujinyuan
2026-03-13 16:34:28 +08:00
parent 8ee870636c
commit 1a5aac9998
3 changed files with 6 additions and 1 deletions

View File

@@ -13,8 +13,9 @@
import { getToken, removeToken } from './storage'
// 基础 URL 配置,根据环境自动切换
// 开发环境使用 window.location.hostname 动态获取主机名,支持局域网 IP 访问
const BASE_URL = process.env.NODE_ENV === 'development'
? 'http://localhost:8085'
? `http://${window.location.hostname}:8085`
: '' // 生产环境由 Nginx 反向代理,使用相对路径
// 请求超时时间(毫秒)

View File

@@ -5,4 +5,7 @@ export default defineConfig({
plugins: [
uni(),
],
server: {
host: '0.0.0.0',
},
})