30 lines
769 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { app, page } from '../app';
import { message } from '@kevisual/system-ui/dist/message';
let isRender = false;
app
.route({
path: 'workspace',
key: 'enter',
run: async (ctx) => {
// 第一次进入页面获取用户信息如果没有登陆则去登陆TODO
// 只根据id来判断工作区。
const url = new URL(location.href);
const isWorksapce = url.pathname.startsWith('/workspace');
if (!isWorksapce) {
message.error('请先进入工作区');
return;
}
console.log('workspace enter');
if (!isRender) {
app.call({
path: 'wallnote',
key: 'render',
});
isRender = true;
}
ctx.body = '';
},
})
.addTo(app);