修改mysql远程连接
This commit is contained in:
@@ -37,7 +37,7 @@ Write-Host "构建成功!" -ForegroundColor Green
|
||||
Write-Host "创建生产环境配置..." -ForegroundColor Yellow
|
||||
@"
|
||||
VITE_APP_TITLE=结伴客后台管理系统
|
||||
VITE_API_BASE_URL=https://api.jiebanke.com
|
||||
VITE_API_BASE_URL=https://webapi.jiebanke.com
|
||||
VITE_APP_VERSION=v1.0.0
|
||||
"@ | Out-File -FilePath .env.production -Encoding UTF8
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ fi
|
||||
echo "创建生产环境配置..."
|
||||
cat > .env.production << EOF
|
||||
VITE_APP_TITLE=结伴客后台管理系统
|
||||
VITE_API_BASE_URL=https://api.jiebanke.com
|
||||
VITE_API_BASE_URL=https://webapi.jiebanke.com
|
||||
VITE_APP_VERSION=v1.0.0
|
||||
EOF
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
const axios = require('axios');
|
||||
|
||||
// API配置
|
||||
const API_BASE_URL = process.env.API_BASE_URL || 'https://api.jiebanke.com';
|
||||
const API_BASE_URL = process.env.API_BASE_URL || 'https://webapi.jiebanke.com';
|
||||
const API_VERSION = process.env.API_VERSION || '/api/v1';
|
||||
|
||||
// 测试用例
|
||||
|
||||
@@ -31,7 +31,7 @@ app.use(helmet());
|
||||
app.use(cors({
|
||||
origin: process.env.NODE_ENV === 'production'
|
||||
? ['https://your-domain.com']
|
||||
: ['https://www.jiebanke.com', 'https://admin.jiebanke.com', 'https://api.jiebanke.com'],
|
||||
: ['https://www.jiebanke.com', 'https://admin.jiebanke.com', 'https://webapi.jiebanke.com'],
|
||||
credentials: true
|
||||
}));
|
||||
|
||||
@@ -79,7 +79,7 @@ app.use('/uploads', express.static('uploads'));
|
||||
// Swagger文档路由
|
||||
if (process.env.NODE_ENV === 'development' || process.env.ENABLE_SWAGGER === 'true') {
|
||||
app.use('/api-docs', swaggerUi.serve, swaggerUi.setup(swaggerSpec));
|
||||
console.log('📚 Swagger文档已启用: https://api.jiebanke.com/api-docs');
|
||||
console.log('📚 Swagger文档已启用: https://webapi.jiebanke.com/api-docs');
|
||||
}
|
||||
|
||||
// 健康检查路由
|
||||
|
||||
@@ -21,11 +21,11 @@ const options = {
|
||||
},
|
||||
servers: [
|
||||
{
|
||||
url: 'https://api.jiebanke.com/api/v1',
|
||||
url: 'https://webapi.jiebanke.com/api/v1',
|
||||
description: '开发环境'
|
||||
},
|
||||
{
|
||||
url: 'https://api.jiebanke.com/api/v1',
|
||||
url: 'https://webapi.jiebanke.com/api/v1',
|
||||
description: '生产环境'
|
||||
}
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@ const http = require('http');
|
||||
function testHealthCheck() {
|
||||
return new Promise((resolve, reject) => {
|
||||
const options = {
|
||||
hostname: 'api.jiebanke.com',
|
||||
hostname: 'webapi.jiebanke.com',
|
||||
port: 3000,
|
||||
path: '/health',
|
||||
method: 'GET'
|
||||
@@ -43,7 +43,7 @@ function testAuthAPI() {
|
||||
});
|
||||
|
||||
const options = {
|
||||
hostname: 'api.jiebanke.com',
|
||||
hostname: 'webapi.jiebanke.com',
|
||||
port: 3000,
|
||||
path: '/api/v1/auth/login',
|
||||
method: 'POST',
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
const config = {
|
||||
// 开发环境
|
||||
development: {
|
||||
baseURL: 'https://api.jiebanke.com/api',
|
||||
baseURL: 'https://webapi.jiebanke.com/api',
|
||||
timeout: 10000
|
||||
},
|
||||
// 生产环境
|
||||
production: {
|
||||
baseURL: 'https://api.jiebanke.com/api',
|
||||
baseURL: 'https://webapi.jiebanke.com/api',
|
||||
timeout: 15000
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// 结伴客系统API测试脚本
|
||||
const axios = require('axios');
|
||||
|
||||
const BASE_URL = 'https://api.jiebanke.com/api/v1';
|
||||
const BASE_URL = 'https://webapi.jiebanke.com/api/v1';
|
||||
|
||||
// 创建axios实例
|
||||
const api = axios.create({
|
||||
|
||||
Reference in New Issue
Block a user