1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/common/config/public/Config.ts

21 lines
508 B
TypeScript
Raw Normal View History

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
if (typeof ServerInject !== 'undefined' && typeof ServerInject.ConfigInject !== 'undefined') {
WebConfigLoader.loadFrontendConfig(Config.Client, ServerInject.ConfigInject);
2017-06-04 21:25:08 +08:00
}
2017-07-09 18:03:17 +08:00
if (Config.Client.publicUrl === '') {
2017-07-09 18:03:17 +08:00
Config.Client.publicUrl = location.origin;
}