This commit is contained in:
weiwei committed 2025-03-21 15:44:22 +08:00
1 parent f2afa90fa8
commit 212e6629fc
2 files changed
+35 -29

No files matched your search

+9 -3
View File
@@ -179,9 +179,15 @@ const doLogout = async () => {
const doScanCode = async () => {
usePayStore().setPayData({})
try {
const res: any = await (window as any).dd.scan({ type: "all", sourceType: ["camera"], scanType: ["cameraScan"] })
// const decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=")
const decodedString = decodeBase64(res.text)
let decodedString: string | undefined = ""
if (isDevEnv()) {
decodedString = decodeBase64("eyJpZCI6IjE4ODk0ODM5Mzg0ODQ1MzEyMDEiLCJuYW1lIjoi5rWL6K+V6LaF5biCIn0=")
uni.showToast({ title: "开发环境不是浙政钉环境,扫码测试", icon: "none" })
} else {
const res: any = await (window as any).dd.scan({ type: "all" })
decodedString = decodeBase64(res.text)
}
if (decodedString) {
const decodedJson = JSON.parse(decodedString)
if (decodedJson?.id && decodedJson?.name) {