improve api url getter
This commit is contained in:
parent
b5a6f8a425
commit
02ba37fab4
@ -290,8 +290,9 @@ export function bytesToReadable(size: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getServerRoot(defaultLocalPort: number) {
|
export function getServerRoot(defaultLocalPort: number) {
|
||||||
if (commonStore.settings.apiUrl)
|
const customApiUrl = commonStore.settings.apiUrl.trim().replace(/\/$/, '');
|
||||||
return commonStore.settings.apiUrl;
|
if (customApiUrl)
|
||||||
|
return customApiUrl;
|
||||||
if (commonStore.platform === 'web')
|
if (commonStore.platform === 'web')
|
||||||
return '';
|
return '';
|
||||||
return `http://127.0.0.1:${defaultLocalPort}`;
|
return `http://127.0.0.1:${defaultLocalPort}`;
|
||||||
|
Loading…
Reference in New Issue
Block a user