添加public管理

This commit is contained in:
2025-03-08 22:44:23 +08:00
parent e7e3e2b140
commit 7b25dbdf08
8 changed files with 44 additions and 2 deletions

View File

@@ -1,4 +1,6 @@
import './list.ts';
import './user-app.ts';
import './public/index.ts';
export * from './module/index.ts';

View File

@@ -33,6 +33,7 @@ export class AppModel extends Model {
declare type: string;
declare uid: string;
declare pid: string;
// 是否是history路由代理模式。静态的直接转minio而不需要缓存下来。
declare proxy: boolean;
declare user: string;
declare status: string;

View File

@@ -0,0 +1 @@
import './list.ts';

View File

@@ -0,0 +1,19 @@
import { app } from '@/app.ts';
import { AppModel } from '../module/index.ts';
// curl http://localhost:4005/api/router?path=app&key=public-list
app
.route({
path: 'app',
key: 'public-list',
})
.define(async (ctx) => {
const list = await AppModel.findAll({
where: {
status: 'running',
},
logging: false,
});
ctx.body = list;
})
.addTo(app);