import{_ as s,o as n,c as a,V as l}from"./chunks/framework.b31a4d00.js";const u=JSON.parse('{"title":"@fesjs/plugin-login","description":"","frontmatter":{},"headers":[],"relativePath":"reference/plugin/plugins/login.md"}'),o={name:"reference/plugin/plugins/login.md"},p=l(`

@fesjs/plugin-login

介绍

管理自定义 login 页面,包括 login 页面权限问题,跳转登陆问题。

启用方式

package.json 中引入依赖:

json
{
    "dependencies": {
        "@fesjs/fes": "^3.0.0",
        "@fesjs/plugin-login": "^3.0.0"
    }
}

运行时配置

js
import { defineRuntimeConfig } from '@fesjs/fes';

export default defineRuntimeConfig({
    login: {
        loginPath: '/login', // 登陆页面路径,默认 /login,也可以用路由的 name
        hasLogin() {
            // 进入页面前判断是否登陆的逻辑,每次跳转非登陆页面都会检测,直到为 true,支持异步
            return true;
        },
    },
});
`,8),e=[p];function t(c,r,D,i,F,y){return n(),a("div",null,e)}const d=s(o,[["render",t]]);export{u as __pageData,d as default};