2017-06-04 21:25:08 +08:00
|
|
|
import {PublicConfigClass} from "./ConfigClass";
|
|
|
|
import {WebConfigLoader} from "typeconfig/src/WebConfigLoader";
|
|
|
|
|
|
|
|
|
|
|
|
declare module ServerInject {
|
2017-06-12 05:33:47 +08:00
|
|
|
export const ConfigInject;
|
2017-06-04 21:25:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export let Config = new PublicConfigClass();
|
|
|
|
|
2017-07-09 18:03:17 +08:00
|
|
|
|
2017-06-04 21:25:08 +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
|
|
|
|
|
|
|
if (Config.Client.publicUrl == "") {
|
|
|
|
Config.Client.publicUrl = location.origin;
|
|
|
|
}
|
|
|
|
|