feat: drone.ci

This commit is contained in:
mozzie 2023-03-20 17:41:08 +08:00
parent 07c81289bc
commit 5b2c557752

View File

@ -67,6 +67,7 @@ export class UserController {
*/ */
@Post('/admin/auth') @Post('/admin/auth')
async AdminAuth(@Body() params: UserAdminAuthDTO) { async AdminAuth(@Body() params: UserAdminAuthDTO) {
try {
const { username, password } = params; const { username, password } = params;
const token = createToken({ hasLogin: true }); const token = createToken({ hasLogin: true });
if (username === 'admin' && password === '123123') { if (username === 'admin' && password === '123123') {
@ -78,6 +79,10 @@ export class UserController {
} else { } else {
return { code: BizCode.ERROR, msg: '用户名密码错误' }; return { code: BizCode.ERROR, msg: '用户名密码错误' };
} }
} catch (error) {
this.ctx.logger.error(error);
return { code: BizCode.ERROR, msg: error };
}
} }
@Get('/web/state') @Get('/web/state')