新增邮件发送和管理员功能

This commit is contained in:
eoao
2025-05-29 17:38:50 +08:00
parent de742d31e7
commit 2341d14b2d
364 changed files with 24202 additions and 1079 deletions

View File

@@ -1,41 +1,11 @@
import { Hono } from 'hono';
const app = new Hono();
import initDB from '../init/init-db';
import initCache from '../init/init-cache';
import verify from '../security/security';
import result from '../model/result';
import { cors } from 'hono/cors';
app.use('*', cors());
let initStatus = true;
app.use('*', async (c, next) => {
if (initStatus) {
await initDB(c);
initStatus = false;
}
await next();
});
let initCacheStatus = true;
app.use('*', async (c, next) => {
if (initCacheStatus) {
await initCache(c);
initCacheStatus = false;
}
await next();
});
app.use('*', async (c, next) => {
if(await verify(c)) {
await next();
}
});
app.onError((err, c) => {
if (err.name === 'BizError') {
console.log(err.message);

View File

@@ -1,4 +1,6 @@
import app from './hono';
import '../security/security'
import '../api/email-api';
import '../api/user-api';
import '../api/login-api';
@@ -6,4 +8,11 @@ import '../api/setting-api';
import '../api/account-api';
import '../api/star-api';
import '../api/test-api';
import '../api/r2-api';
import '../api/resend-api';
import '../api/user-api';
import '../api/my-api';
import '../api/role-api'
import '../api/sys-email-api'
import '../api/init-api'
export default app;