This commit is contained in:
@jyuhsin
2026-01-04 16:11:43 +08:00
parent 8d30f2bb4b
commit d622d70b6c
2 changed files with 32 additions and 19 deletions
@@ -44,7 +44,7 @@ public class ScanController {
@SaCheckLogin @SaCheckLogin
public Object handle(@Param("bizType") String bizType, @Param("params") String params) { public Object handle(@Param("bizType") String bizType, @Param("params") String params) {
if(StrUtil.isBlank(bizType)) { if(StrUtil.isBlank(bizType)) {
return Result.error("参数缺失"); return Result.error("请使用智慧工会系统二维码");
} }
Map<String, Object> paramsMap = Json.fromJson(Map.class, params); Map<String, Object> paramsMap = Json.fromJson(Map.class, params);
return dispatcher.dispatch(bizType, paramsMap); return dispatcher.dispatch(bizType, paramsMap);
@@ -230,6 +230,7 @@ layout("/layouts/platform_h5.html"){
}, },
async onHandle(decodedText) { async onHandle(decodedText) {
try {
// 防重:如果正在处理,直接忽略 // 防重:如果正在处理,直接忽略
if (this.isProcessing) return; if (this.isProcessing) return;
@@ -242,18 +243,30 @@ layout("/layouts/platform_h5.html"){
bizType: bizType, bizType: bizType,
params: JSON.stringify({ userId: userId, handle: false }), params: JSON.stringify({ userId: userId, handle: false }),
}) })
} catch (e) {
this.result = {
code: 99,
msg: '请使用智慧工会系统身份二维码'
}
this.resultVisible = true this.resultVisible = true
}
}, },
resultConfirm() { resultConfirm() {
try {
const { bizType, userId } = JSON.parse(this.decodedText) const { bizType, userId } = JSON.parse(this.decodedText)
this.$axios.post('/platform/scan/handle', { this.$axios.post('/platform/scan/handle', {
bizType: bizType, bizType: bizType,
params: JSON.stringify({ userId: userId, handle: true }), params: JSON.stringify({ userId: userId, handle: true }),
}) })
} catch (e) {
} finally {
this.isProcessing = false; this.isProcessing = false;
this.initCamera() this.initCamera()
} }
}
}, },
async created() { async created() {