Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store-front-end",
"version": "2.15.63",
"version": "2.15.64",
"private": true,
"scripts": {
"dev": "vite --host",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const processUrlApiConfig = async () => {
.find(i => i[0] === 'magicpath');

if (hasApiParam) {
const apiValue = decodeURIComponent(hasApiParam[1]);
const apiValue = decodeURIComponent(hasApiParam[1]).replace(/\/$/, ''); // 去除末尾斜杠;
urlApiValue.value = apiValue;
urlApiError.value = '通过 URL 参数指定的 API 地址连接失败,请检查地址是否正确';
hasUrlParams = true;
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/useHostAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getHostAPIUrl = (): string => {
apis.find(api => api.name === current)?.url ||
import.meta.env.VITE_API_URL ||
'https://sub.store'
);
).replace(/\/$/, ''); // 去除末尾斜杠;
};

const setHostAPI = (hostAPI: HostAPIStorage) => {
Expand Down Expand Up @@ -167,7 +167,7 @@ export const useHostAPI = () => {

// 优先处理api参数
if (apiUrl) {
const url = decodeURIComponent(apiUrl[1]);
const url = decodeURIComponent(apiUrl[1]).replace(/\/$/, ''); // 去除末尾斜杠;
if (!url) return await errorCb?.();

// 检查是否已存在相同URL的API
Expand Down