feat: 整合请求地址

This commit is contained in:
RISE
2026-05-21 15:07:46 +08:00
parent fa321e5083
commit c1337cbd80
3 changed files with 31 additions and 3 deletions

24
utils/config.js Normal file
View File

@@ -0,0 +1,24 @@
// 后端 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;