feat: 初始化项目结构并添加核心功能模块
- 新增文档模板和导航结构 - 实现服务器基础API路由和控制器 - 添加扩展插件配置和前端框架 - 引入多租户和权限管理模块 - 集成日志和数据库配置 - 添加核心业务模型和类型定义
This commit is contained in:
37
dashboard/.umi/core/terminal.ts
Normal file
37
dashboard/.umi/core/terminal.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// @ts-nocheck
|
||||
// This file is generated by Umi automatically
|
||||
// DO NOT CHANGE IT MANUALLY!
|
||||
let count = 0;
|
||||
let groupLevel = 0;
|
||||
function send(type: string, message?: string) {
|
||||
if(process.env.NODE_ENV==='production'){
|
||||
return;
|
||||
}else{
|
||||
const encodedMessage = message ? `&m=${encodeURI(message)}` : '';
|
||||
fetch(`/__umi/api/terminal?type=${type}&t=${Date.now()}&c=${count++}&g=${groupLevel}${encodedMessage}`, { mode: 'no-cors' })
|
||||
}
|
||||
}
|
||||
function prettyPrint(obj: any) {
|
||||
return JSON.stringify(obj, null, 2);
|
||||
}
|
||||
function stringifyObjs(objs: any[]) {
|
||||
const obj = objs.length > 1 ? objs.map(stringify).join(' ') : objs[0];
|
||||
return typeof obj === 'object' ? `${prettyPrint(obj)}` : obj.toString();
|
||||
}
|
||||
function stringify(obj: any) {
|
||||
return typeof obj === 'object' ? `${JSON.stringify(obj)}` : obj.toString();
|
||||
}
|
||||
const terminal = {
|
||||
log(...objs: any[]) { send('log', stringifyObjs(objs)) },
|
||||
info(...objs: any[]) { send('info', stringifyObjs(objs)) },
|
||||
warn(...objs: any[]) { send('warn', stringifyObjs(objs)) },
|
||||
error(...objs: any[]) { send('error', stringifyObjs(objs)) },
|
||||
group() { groupLevel++ },
|
||||
groupCollapsed() { groupLevel++ },
|
||||
groupEnd() { groupLevel && --groupLevel },
|
||||
clear() { send('clear') },
|
||||
trace(...args: any[]) { console.trace(...args) },
|
||||
profile(...args: any[]) { console.profile(...args) },
|
||||
profileEnd(...args: any[]) { console.profileEnd(...args) },
|
||||
};
|
||||
export { terminal };
|
||||
Reference in New Issue
Block a user