- 在 AI 教练聊天界面中添加消息自动滚动功能,提升用户体验 - 更新消息发送逻辑,确保新消息渲染后再滚动 - 在个人信息页面中集成用户资料拉取功能,支持每次聚焦时更新用户信息 - 修改登录页面,增加身份令牌验证,确保安全性 - 更新样式以适应新功能的展示和交互
14 lines
488 B
TypeScript
14 lines
488 B
TypeScript
export const API_ORIGIN = 'https://pilate.richarjiang.com';
|
|
export const API_BASE_PATH = '/api';
|
|
|
|
export function buildApiUrl(path: string): string {
|
|
const normalizedPath = path.startsWith('/') ? path : `/${path}`;
|
|
// 如果传入的路径已包含 /api 前缀,则直接拼接域名;否则自动补上 /api
|
|
const finalPath = normalizedPath.startsWith(`${API_BASE_PATH}/`)
|
|
? normalizedPath
|
|
: `${API_BASE_PATH}${normalizedPath}`;
|
|
return `${API_ORIGIN}${finalPath}`;
|
|
}
|
|
|
|
|