修复oauth.google setting字段异常问题,将__mock__添加至ignore

This commit is contained in:
undefined committed 2020-09-07 22:55:18 +08:00
1 parent 147637d539
commit 6ba93841ea
17 files changed
+103 -16

No files matched your search

+1 -1
View File
@@ -159,7 +159,7 @@ class HomeSecurityHandler extends Handler {
if (udoc) throw new UserAlreadyExistError(email);
const [code] = await token.add(
token.TYPE_CHANGEMAIL,
await system.get('changemail_token_expire_seconds') as number,
await system.get('changemail_token_expire_seconds'),
{ uid: this.user._id, email },
);
const m = await this.renderHTML('user_changemail_mail.html', {
+2
View File
@@ -151,10 +151,12 @@ class SystemSettingHandler extends SystemHandler {
if (typeof args[key] === 'object') {
for (const subkey in args[key]) {
if (typeof set(`${key}.${subkey}`, args[key][subkey]) !== 'undefined') {
// @ts-ignore
tasks.push(system.set(`${key}.${subkey}`, set(`${key}.${subkey}`, args[key][subkey])));
}
}
} else if (typeof set(key, args[key]) !== 'undefined') {
// @ts-ignore
tasks.push(system.set(key, set(key, args[key])));
}
}
+2 -2
View File
@@ -62,7 +62,7 @@ class UserRegisterHandler extends Handler {
this.limitRate('send_mail', 3600, 30);
const t = await token.add(
token.TYPE_REGISTRATION,
await system.get('registration_token_expire_seconds') as number,
await system.get('registration_token_expire_seconds'),
{ mail },
);
if (await system.get('smtp.user')) {
@@ -118,7 +118,7 @@ class UserLostPassHandler extends Handler {
if (!udoc) throw new UserNotFoundError(mail);
const [tid] = await token.add(
token.TYPE_LOSTPASS,
await system.get('lostpass_token_expire_seconds') as number,
await system.get('lostpass_token_expire_seconds'),
{ uid: udoc._id },
);
const m = await this.renderHTML('user_lostpass_mail', { url: `lostpass/${tid}`, uname: udoc.uname });