feat: 整合请求地址
This commit is contained in:
24
utils/config.js
Normal file
24
utils/config.js
Normal 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;
|
||||
Reference in New Issue
Block a user