generated from template/vite-react-template
feat: update new feature temp for panel
This commit is contained in:
29
template/workspace/entry.ts
Normal file
29
template/workspace/entry.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user