1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- import { AuthModule } from "..";
- type BgStyle = {
- image: string;
- repeat?: string;
- position?: string;
- size?: string;
- };
- const jumpActions = {
- success: createOpts({
- action() {
- const redirectUrl = this.helper.getRedirectPath();
- this.helper.linkTo(redirectUrl || this.config.loginJumpPath, {
- replace: !!redirectUrl,
- });
- },
- }),
- needLogin: createOpts({
- action() {
- this.helper.linkTo(this.config.loginPath, {
- replace: true,
- redirect: true,
- });
- },
- }),
- logout: createOpts({
- action() {
- this.helper.linkTo(this.config.loginPath);
- },
- }),
- };
- export const User_Config = {
- singlePage: false,
- key: "", //queentreesku3d
- companyKey: "",
- regInfo: {
- key: "", //usercenter
- },
- loginPath: "/login",
- loginJumpPath: "/",
- logoutJumpPath: "/",
- needCompanyLogin: false,
- needRegister: false,
- needResetPwd: false,
- perms: null as {
- baseURL: string;
- } | null,
- banner: null as {
- mode?: string;
- background: BgStyle;
- title?: string;
- subTitle?: string;
- } | null,
- layout: null as {
- background?: BgStyle;
- } | null,
- jumpOptions: {
- loginSucc: jumpActions.success,
- needLogin: jumpActions.needLogin,
- tokenExpire: jumpActions.needLogin,
- logout: jumpActions.logout,
- },
- };
- function createOpts<T extends { action: (this: AuthModule) => void }>(
- opts: T
- ): T {
- return opts;
- }
|