新增公告弹窗和无人收件开关
This commit is contained in:
@@ -40,7 +40,7 @@ const accountService = {
|
||||
}
|
||||
|
||||
|
||||
let accountRow = await this.selectByEmailIncludeDelNoCase(c, email);
|
||||
let accountRow = await this.selectByEmailIncludeDel(c, email);
|
||||
|
||||
if (accountRow && accountRow.isDel === isDel.DELETE) {
|
||||
throw new BizError(t('isDelAccount'));
|
||||
@@ -92,23 +92,8 @@ const accountService = {
|
||||
return accountRow;
|
||||
},
|
||||
|
||||
selectByEmailIncludeDelNoCase(c, email) {
|
||||
return orm(c)
|
||||
.select()
|
||||
.from(account)
|
||||
.where(sql`${account.email} COLLATE NOCASE = ${email}`)
|
||||
.get();
|
||||
},
|
||||
selectByEmailIncludeDel(c, email) {
|
||||
return orm(c).select().from(account).where(eq(account.email, email)).get();
|
||||
},
|
||||
|
||||
selectByEmail(c, email) {
|
||||
return orm(c).select().from(account).where(
|
||||
and(
|
||||
eq(account.email, email),
|
||||
eq(account.isDel, isDel.NORMAL)))
|
||||
.get();
|
||||
return orm(c).select().from(account).where(sql`${account.email} COLLATE NOCASE = ${email}`).get();
|
||||
},
|
||||
|
||||
list(c, params, userId) {
|
||||
|
||||
@@ -58,9 +58,9 @@ const emailService = {
|
||||
)
|
||||
.where(
|
||||
and(
|
||||
timeSort ? gt(email.emailId, emailId) : lt(email.emailId, emailId),
|
||||
eq(email.accountId, accountId),
|
||||
eq(email.userId, userId),
|
||||
eq(email.accountId, accountId),
|
||||
timeSort ? gt(email.emailId, emailId) : lt(email.emailId, emailId),
|
||||
eq(email.type, type),
|
||||
eq(email.isDel, isDel.NORMAL)
|
||||
)
|
||||
@@ -280,7 +280,7 @@ const emailService = {
|
||||
|
||||
|
||||
if (error) {
|
||||
throw new BizError(error.error);
|
||||
throw new BizError(error.message);
|
||||
}
|
||||
|
||||
html = this.imgReplace(html, null, r2Domain);
|
||||
|
||||
@@ -68,7 +68,7 @@ const loginService = {
|
||||
regKeyId = result?.regKeyId
|
||||
}
|
||||
|
||||
const accountRow = await accountService.selectByEmailIncludeDelNoCase(c, email);
|
||||
const accountRow = await accountService.selectByEmailIncludeDel(c, email);
|
||||
|
||||
if (accountRow && accountRow.isDel === isDel.DELETE) {
|
||||
throw new BizError(t('isDelUser'));
|
||||
|
||||
@@ -23,11 +23,7 @@ const roleService = {
|
||||
|
||||
let roleRow = await orm(c).select().from(role).where(eq(role.name, name)).get();
|
||||
|
||||
if (roleRow) {
|
||||
throw new BizError(t('roleNameExist'));
|
||||
}
|
||||
|
||||
const notEmailIndex = banEmail.findIndex(item => !verifyUtils.isEmail(item))
|
||||
const notEmailIndex = banEmail.findIndex(item => (!verifyUtils.isEmail(item) && !verifyUtils.isDomain(item)))
|
||||
|
||||
if (notEmailIndex > -1) {
|
||||
throw new BizError(t('notEmail'));
|
||||
@@ -76,7 +72,7 @@ const roleService = {
|
||||
|
||||
delete params.isDefault
|
||||
|
||||
const notEmailIndex = banEmail.findIndex(item => !verifyUtils.isEmail(item))
|
||||
const notEmailIndex = banEmail.findIndex(item => (!verifyUtils.isEmail(item) && !verifyUtils.isDomain(item)))
|
||||
|
||||
if (notEmailIndex > -1) {
|
||||
throw new BizError(t('notEmail'));
|
||||
@@ -168,7 +164,7 @@ const roleService = {
|
||||
|
||||
const availIndex = availDomain.findIndex(item => {
|
||||
const domain = emailUtils.getDomain(email.toLowerCase());
|
||||
const availDomainItem = emailUtils.getDomain(item.toLowerCase());
|
||||
const availDomainItem = item.toLowerCase();
|
||||
console.log(domain,availDomainItem)
|
||||
return domain === availDomainItem
|
||||
})
|
||||
|
||||
@@ -139,7 +139,15 @@ const settingService = {
|
||||
domainList:settingRow.domainList,
|
||||
regKey: settingRow.regKey,
|
||||
regVerifyOpen: settingRow.regVerifyOpen,
|
||||
addVerifyOpen: settingRow.addVerifyOpen
|
||||
addVerifyOpen: settingRow.addVerifyOpen,
|
||||
noticeTitle: settingRow.noticeTitle,
|
||||
noticeContent: settingRow.noticeContent,
|
||||
noticeType: settingRow.noticeType,
|
||||
noticeDuration: settingRow.noticeDuration,
|
||||
noticePosition: settingRow.noticePosition,
|
||||
noticeWidth: settingRow.noticeWidth,
|
||||
noticeOffset: settingRow.noticeOffset,
|
||||
notice: settingRow.notice,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ const userService = {
|
||||
},
|
||||
|
||||
selectByEmailIncludeDel(c, email) {
|
||||
return orm(c).select().from(user).where(eq(user.email, email)).get();
|
||||
return orm(c).select().from(user).where(sql`${user.email} COLLATE NOCASE = ${email}`).get();
|
||||
},
|
||||
|
||||
selectById(c, userId) {
|
||||
@@ -355,6 +355,8 @@ const userService = {
|
||||
|
||||
const userId = await userService.insert(c, { email, password: hash, salt, type });
|
||||
|
||||
await userService.updateUserInfo(c, userId, true);
|
||||
|
||||
await accountService.insert(c, { userId: userId, email, type, name: emailUtils.getName(email) });
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user