mirror of
https://github.com/MrXujiang/h5-Dooring.git
synced 2026-01-04 10:08:10 +00:00
27 lines
711 B
TypeScript
27 lines
711 B
TypeScript
// @ts-nocheck
|
|
import { createBrowserHistory } from '/Users/apple/Desktop/github/zhiku.tec/h5-visible-tool/node_modules/@umijs/runtime';
|
|
|
|
let options = {
|
|
"basename": "h5_plus"
|
|
};
|
|
if ((<any>window).routerBase) {
|
|
options.basename = (<any>window).routerBase;
|
|
}
|
|
|
|
// remove initial history because of ssr
|
|
let history: any = process.env.__IS_SERVER ? null : createBrowserHistory(options);
|
|
export const createHistory = (hotReload = false) => {
|
|
if (!hotReload) {
|
|
history = createBrowserHistory(options);
|
|
}
|
|
|
|
return history;
|
|
};
|
|
|
|
// 通常仅微前端场景需要调用这个 API
|
|
export const setCreateHistoryOptions = (newOpts: any = {}) => {
|
|
options = { ...options, ...newOpts };
|
|
};
|
|
|
|
export { history };
|