diff --git a/back/services/auth.ts b/back/services/auth.ts index c0c47594..34ee091c 100644 --- a/back/services/auth.ts +++ b/back/services/auth.ts @@ -40,7 +40,7 @@ export default class AuthService { const content = this.getAuthInfo(); const timestamp = Date.now(); if (content) { - const { + let { username: cUsername, password: cPassword, retries = 0, @@ -48,7 +48,10 @@ export default class AuthService { lastip, lastaddr, twoFactorActivated, + twoFactorActived, } = content; + // patch old field + twoFactorActivated = twoFactorActivated || twoFactorActived; if ( (cUsername === 'admin' && cPassword === 'admin') || @@ -237,6 +240,7 @@ export default class AuthService { const authInfo = this.getAuthInfo(); this.updateAuthInfo(authInfo, { twoFactorActivated: false, + twoFactorActived: false, twoFactorSecret: '', }); return true; diff --git a/src/utils/config.ts b/src/utils/config.ts index 7060ae79..f7886b63 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -162,7 +162,6 @@ export default { { label: 'pushPlusUser', tip: '一对多推送的“群组编码”(一对多推送下面->您的群组(如无则新建)->群组编码,如果您是创建群组人。也需点击“查看二维码”扫描绑定,否则不能接受群组消息推送)', - required: true, }, ], email: [