From 47c4ade15b643210a801f28135cdd4b93eb31e08 Mon Sep 17 00:00:00 2001 From: linju Date: Fri, 8 Dec 2023 14:54:43 +0800 Subject: [PATCH] Update check-id-card.uts --- uni_modules/uni-id-pages-x/lib/check-id-card.uts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni_modules/uni-id-pages-x/lib/check-id-card.uts b/uni_modules/uni-id-pages-x/lib/check-id-card.uts index 6e37934..dc55870 100644 --- a/uni_modules/uni-id-pages-x/lib/check-id-card.uts +++ b/uni_modules/uni-id-pages-x/lib/check-id-card.uts @@ -1,5 +1,5 @@ function checkIdCard (idCardNumber: string): boolean { - if (typeof idCardNumber !== 'string' || idCardNumber.length !== 18) return false + if (typeof idCardNumber != 'string' || (idCardNumber.length as number) != 18) return false const coefficient = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2] const checkCode = [1, 0, 'x', 9, 8, 7, 6, 5, 4, 3, 2] -- GitLab