fix(web): remove trailing slash from api base url (#1621)

This commit is contained in:
C.C.
2025-12-04 23:06:28 +08:00
committed by GitHub
parent d686c8721f
commit 88a55859ac

View File

@@ -61,7 +61,7 @@ export class ApiClient {
constructor(baseUrl: string, authFailedCb: Function | undefined = undefined) {
this.client = axios.create({
baseURL: baseUrl + '/api/v1',
baseURL: baseUrl.replace(/\/+$/, '') + '/api/v1',
withCredentials: true, // 如果需要支持跨域携带cookie
headers: {
'Content-Type': 'application/json',