use local API when it's working, even if a custom API URL is provided
This commit is contained in:
parent
c8470e77fd
commit
d18218f21a
@ -290,12 +290,15 @@ export function bytesToReadable(size: number) {
|
||||
}
|
||||
|
||||
export function getServerRoot(defaultLocalPort: number) {
|
||||
const defaultRoot = `http://127.0.0.1:${defaultLocalPort}`;
|
||||
if (commonStore.status.status !== ModelStatus.Offline)
|
||||
return defaultRoot;
|
||||
const customApiUrl = commonStore.settings.apiUrl.trim().replace(/\/$/, '');
|
||||
if (customApiUrl)
|
||||
return customApiUrl;
|
||||
if (commonStore.platform === 'web')
|
||||
return '';
|
||||
return `http://127.0.0.1:${defaultLocalPort}`;
|
||||
return defaultRoot;
|
||||
}
|
||||
|
||||
export function absPathAsset(path: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user