File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed
Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " sub-store-front-end" ,
3- "version" : " 2.15.63 " ,
3+ "version" : " 2.15.64 " ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " vite --host" ,
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ const processUrlApiConfig = async () => {
9494 .find (i => i [0 ] === ' magicpath' );
9595
9696 if (hasApiParam ) {
97- const apiValue = decodeURIComponent (hasApiParam [1 ]);
97+ const apiValue = decodeURIComponent (hasApiParam [1 ]). replace ( / \/ $ / , ' ' ); // 去除末尾斜杠 ;
9898 urlApiValue .value = apiValue ;
9999 urlApiError .value = ' 通过 URL 参数指定的 API 地址连接失败,请检查地址是否正确' ;
100100 hasUrlParams = true ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const getHostAPIUrl = (): string => {
2525 apis . find ( api => api . name === current ) ?. url ||
2626 import . meta. env . VITE_API_URL ||
2727 'https://sub.store'
28- ) ;
28+ ) . replace ( / \/ $ / , '' ) ; // 去除末尾斜杠 ;
2929} ;
3030
3131const setHostAPI = ( hostAPI : HostAPIStorage ) => {
@@ -167,7 +167,7 @@ export const useHostAPI = () => {
167167
168168 // 优先处理api参数
169169 if ( apiUrl ) {
170- const url = decodeURIComponent ( apiUrl [ 1 ] ) ;
170+ const url = decodeURIComponent ( apiUrl [ 1 ] ) . replace ( / \/ $ / , '' ) ; // 去除末尾斜杠 ;
171171 if ( ! url ) return await errorCb ?.( ) ;
172172
173173 // 检查是否已存在相同URL的API
You can’t perform that action at this time.
0 commit comments