cool-admin-midway/src/welcome.ts
2024-01-25 17:50:25 +08:00

20 lines
471 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 { Controller, Get, Inject } from '@midwayjs/decorator';
import { Context } from '@midwayjs/koa';
import * as packageJson from '../package.json';
/**
* 欢迎界面
*/
@Controller('/')
export class WelcomeController {
@Inject()
ctx: Context;
@Get('/', { summary: '欢迎界面' })
public async welcome() {
await this.ctx.render('welcome', {
text: `HELLO COOL-ADMIN v${packageJson.version} 一个项目用COOL就够了`,
});
}
}