@wlszkj/system-management
v0.1.0
Published
Reusable Vue 3 system management module for WeiLan applications.
Readme
@wlszkj/system-management
Reusable Vue 3 system management module for WeiLan applications.
It includes:
- role management
- organization and user management
- menu management
- role authorization
- system management routes and sidebar layout
- configurable API client and menu access store
Install
pnpm add @wlszkj/system-managementThe host application must provide these peer dependencies:
pnpm add vue vue-router pinia element-plus @element-plus/icons-vueUsage
import '@wlszkj/system-management/style.css'
import {
createSystemManagementRoutes,
installSystemManagement,
resolveSystemManagementRouteAccess,
} from '@wlszkj/system-management'
app.use(installSystemManagement({
authAdminBase: '/system/auth/admin',
orgBindingBase: '/api/org/bindings',
currentMenuPath: '/system/auth/menus',
getCurrentUserId: () => authStore.user?.id,
headers: () => ({
Authorization: authStore.tokenValue,
}),
}))
const router = createRouter({
history: createWebHistory(),
routes: [
...createSystemManagementRoutes(),
],
})
router.beforeEach(async (to) => {
const result = await resolveSystemManagementRouteAccess(to)
return result
})Local Pack
pnpm install
pnpm pack:localThen install the generated .tgz in another project:
pnpm add ./weilan-system-management-0.1.0.tgz