Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): 二维码扫描出错时微信js报错 #36

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### fixed

- fix(frontend): 锁屏前在 TOTP 页面锁屏后小程序 js 报异常(#35)
- fix(frontend): 优化二维码扫描出错时微信js报错(#36)

## v1.1.6

Expand Down
2 changes: 2 additions & 0 deletions miniprogram/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,7 @@ App<GlobalData>({
}

logger.error('未知错误', e)

await wx.showToast({ title: '出现未知错误', icon: 'error' })
}
})
6 changes: 3 additions & 3 deletions miniprogram/pages/totp/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ Page({
async create() {
this.data.isScanQrCode = true

const scan = await wx
.scanCode({ scanType: ['qrCode'] })
.catch(() => Promise.reject(new WeixinError(CODE.WEIXIN_QR_CODE)))
const scan = await wx.scanCode({ scanType: ['qrCode'] }).catch(() => {
throw new WeixinError(CODE.WEIXIN_QR_CODE)
})

this.data.isScanQrCode = false

Expand Down