修复: 移除API地址硬编码,统一使用nginx代理
- 修复frontend/app.js中的localhost:40001硬编码 - 修复frontend/share.html中的localhost:40001硬编码 - 所有API请求现在统一通过nginx代理访问 - 支持任意端口号部署,无需修改前端代码
This commit is contained in:
@@ -4,10 +4,8 @@ createApp({
|
||||
data() {
|
||||
return {
|
||||
// API配置
|
||||
// API配置 - 动态适配localhost或生产环境
|
||||
apiBase: window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'
|
||||
? 'http://localhost:40001'
|
||||
: window.location.protocol + '//' + window.location.host,
|
||||
// API配置 - 通过nginx代理访问
|
||||
apiBase: window.location.protocol + '//' + window.location.host,
|
||||
|
||||
// 用户状态
|
||||
isLoggedIn: false,
|
||||
|
||||
@@ -583,10 +583,8 @@
|
||||
createApp({
|
||||
data() {
|
||||
return {
|
||||
// API配置 - 动态适配localhost或生产环境
|
||||
apiBase: window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'
|
||||
? 'http://localhost:40001'
|
||||
: window.location.protocol + '//' + window.location.host,
|
||||
// API配置 - 通过nginx代理访问
|
||||
apiBase: window.location.protocol + '//' + window.location.host,
|
||||
shareCode: '',
|
||||
password: '',
|
||||
needPassword: false,
|
||||
|
||||
Reference in New Issue
Block a user