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 6e379344daae8f8237c8b87dcd184a944cecb1cd..dc5587070b103e97b4eb662ec46d270192d07070 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]