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 1
1
{
2
2
"name" : " sub-store-front-end" ,
3
- "version" : " 2.15.63 " ,
3
+ "version" : " 2.15.64 " ,
4
4
"private" : true ,
5
5
"scripts" : {
6
6
"dev" : " vite --host" ,
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ const processUrlApiConfig = async () => {
94
94
.find (i => i [0 ] === ' magicpath' );
95
95
96
96
if (hasApiParam ) {
97
- const apiValue = decodeURIComponent (hasApiParam [1 ]);
97
+ const apiValue = decodeURIComponent (hasApiParam [1 ]). replace ( / \/ $ / , ' ' ); // 去除末尾斜杠 ;
98
98
urlApiValue .value = apiValue ;
99
99
urlApiError .value = ' 通过 URL 参数指定的 API 地址连接失败,请检查地址是否正确' ;
100
100
hasUrlParams = true ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export const getHostAPIUrl = (): string => {
25
25
apis . find ( api => api . name === current ) ?. url ||
26
26
import . meta. env . VITE_API_URL ||
27
27
'https://sub.store'
28
- ) ;
28
+ ) . replace ( / \/ $ / , '' ) ; // 去除末尾斜杠 ;
29
29
} ;
30
30
31
31
const setHostAPI = ( hostAPI : HostAPIStorage ) => {
@@ -167,7 +167,7 @@ export const useHostAPI = () => {
167
167
168
168
// 优先处理api参数
169
169
if ( apiUrl ) {
170
- const url = decodeURIComponent ( apiUrl [ 1 ] ) ;
170
+ const url = decodeURIComponent ( apiUrl [ 1 ] ) . replace ( / \/ $ / , '' ) ; // 去除末尾斜杠 ;
171
171
if ( ! url ) return await errorCb ?.( ) ;
172
172
173
173
// 检查是否已存在相同URL的API
You can’t perform that action at this time.
0 commit comments