新增最近联系人功能

This commit is contained in:
eoao
2025-10-10 22:22:00 +08:00
parent 8ee140743a
commit 1b441774a4
10 changed files with 238 additions and 28 deletions

View File

@@ -13,6 +13,7 @@ import timezone from 'dayjs/plugin/timezone';
import roleService from '../service/role-service';
import verifyUtils from '../utils/verify-utils';
import r2Service from '../service/r2-service';
import userService from '../service/user-service';
dayjs.extend(utc);
dayjs.extend(timezone);
@@ -58,7 +59,9 @@ export async function email(message, env, ctx) {
return;
}
if (account && account.email !== env.admin) {
const userRow = await userService.selectById({ env: env }, account.userId);
if (account && userRow.email !== env.admin) {
let { banEmail, banEmailType, availDomain } = await roleService.selectByUserId({ env: env }, account.userId);

View File

@@ -83,7 +83,6 @@ const init = {
`ALTER TABLE setting ADD COLUMN notice INTEGER NOT NULL DEFAULT 0;`,
`ALTER TABLE setting ADD COLUMN no_recipient INTEGER NOT NULL DEFAULT 1;`,
`UPDATE role SET avail_domain = '' WHERE role.avail_domain LIKE '@%';`,
`UPDATE role SET ban_email = '';`,
`CREATE INDEX IF NOT EXISTS idx_email_user_id_account_id ON email(user_id, account_id);`
];