2018-05-13 00:19:51 +08:00
|
|
|
import {PublicConfigClass} from './ConfigClass';
|
|
|
|
import {WebConfigLoader} from 'typeconfig/src/WebConfigLoader';
|
2017-06-04 21:25:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
declare module ServerInject {
|
2018-11-29 06:49:33 +08:00
|
|
|
export const ConfigInject: PublicConfigClass;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export let Config = new PublicConfigClass();
|
|
|
|
|
2017-07-09 18:03:17 +08:00
|
|
|
|
2018-05-13 00:19:51 +08:00
|
|
|
if (typeof ServerInject !== 'undefined' && typeof ServerInject.ConfigInject !== 'undefined') {
|
2017-06-12 05:33:47 +08:00
|
|
|
WebConfigLoader.loadFrontendConfig(Config.Client, ServerInject.ConfigInject);
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
|
2017-07-09 18:03:17 +08:00
|
|
|
|
2018-05-13 00:19:51 +08:00
|
|
|
if (Config.Client.publicUrl === '') {
|
2017-07-09 18:03:17 +08:00
|
|
|
Config.Client.publicUrl = location.origin;
|
|
|
|
}
|
|
|
|
|