mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-06-20 20:19:17 +08:00
* feat: 基础功能 * feat: 支持时间戳 * refactor(plugin-watermark): 优化实现 * feat(plugin-watermark): 提供开关 * docs: 添加文档 * docs: 优化文档
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
|
|
|
|
import { access as accessApi, pinia, createWatermark } from '@fesjs/fes';
|
|
import PageLoading from '@/components/PageLoading';
|
|
import UserCenter from '@/components/UserCenter';
|
|
import { useStore } from '@/store/main';
|
|
import { ref } from 'vue';
|
|
|
|
export const beforeRender = {
|
|
loading: <PageLoading />,
|
|
action() {
|
|
const { setRole } = accessApi;
|
|
return new Promise((resolve) => {
|
|
setTimeout(() => {
|
|
const store = useStore(pinia);
|
|
store.$patch({
|
|
userName: '李雷'
|
|
});
|
|
setRole('admin');
|
|
resolve({
|
|
userName: '李雷'
|
|
});
|
|
createWatermark({ content: '万纯(harrywan)' });
|
|
}, 1000);
|
|
});
|
|
}
|
|
};
|
|
|
|
export const layout = initialValue => ({
|
|
...initialValue,
|
|
customHeader: <UserCenter />,
|
|
menus: (defaultMenuData) => {
|
|
const menusRef = ref(defaultMenuData);
|
|
// watch(() => initialValue.initialState.userName, () => {
|
|
// menusRef.value = [{
|
|
// name: 'store'
|
|
// }];
|
|
// });
|
|
return menusRef;
|
|
}
|
|
});
|