You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
497 B
TypeScript
24 lines
497 B
TypeScript
import { configure } from 'mobx';
|
|
import API from './api';
|
|
import { Session } from './utils';
|
|
|
|
configure({ enforceActions: 'observed' });
|
|
|
|
export interface API {
|
|
user?: any;
|
|
}
|
|
|
|
export async function getInitialState(): Promise<API> {
|
|
const user = Session.get();
|
|
return { user };
|
|
}
|
|
|
|
export const qiankun = {
|
|
// 应用加载之前
|
|
async bootstrap(props: any) {},
|
|
// 应用 render 之前触发
|
|
async mount(props: any) {},
|
|
// 应用卸载之后触发
|
|
async unmount(props: any) {},
|
|
};
|