Files
weapp/utils/config.js
2026-05-21 15:07:46 +08:00

25 lines
495 B
JavaScript

// 后端 API 地址配置
const CONFIG = {
// 基础域名(生产环境请替换为你的后端地址)
baseUrl: "https://ai-api.aitools666.com",
// 接口地址
api: {
login: "/login",
chat: "/chat",
generatePost: "/generate-post",
},
// 获取完整 HTTP URL
getHttpUrl(path) {
return this.baseUrl + path;
},
// 获取完整 WebSocket URL
getWsUrl(path) {
return this.baseUrl.replace(/^https?:/, "wss:") + path;
},
};
module.exports = CONFIG;