mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-01 05:46:46 +08:00
* feat: 添加 login 插件 * docs: 优化 access docs 文档 * refactor: beforeRender迁移到router创建后 * fix: 修复清除webpack-cache问题 * refactor: 优化 plugin 插件 Co-authored-by: wanchun <445436867@qq.com>
28 lines
754 B
JavaScript
28 lines
754 B
JavaScript
import { access as accessApi } from '@fesjs/fes';
|
|
import PageLoading from '@/components/pageLoading.vue';
|
|
import UserCenter from '@/components/userCenter.vue';
|
|
import { useStore } from '@/store/main';
|
|
|
|
export const beforeRender = {
|
|
loading: <PageLoading />,
|
|
action() {
|
|
const { setRole } = accessApi;
|
|
return new Promise((resolve) => {
|
|
setTimeout(() => {
|
|
const store = useStore();
|
|
store.$patch({
|
|
userName: '李雷',
|
|
});
|
|
setRole('admin');
|
|
resolve({
|
|
userName: '李雷',
|
|
});
|
|
}, 1000);
|
|
});
|
|
},
|
|
};
|
|
|
|
export const layout = {
|
|
renderCustom: () => <UserCenter />,
|
|
};
|