Commit cd0d300e authored by gengchunlei's avatar gengchunlei

微信领取身份证最后一位有效性

parent 050921d2
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
<script> <script>
import {Toast} from 'mint-ui' import {Toast} from 'mint-ui'
import {getQueryVariable, idCardV} from "../../utils/common"; import {getQueryVariable, idCardV, validateIdCard} from "../../utils/common";
import {getCheckShortMessage, getShortMessage, getUserInfoByIdCard} from "../../utils/api"; import {getCheckShortMessage, getShortMessage, getUserInfoByIdCard} from "../../utils/api";
import NoData from "../component/noData"; import NoData from "../component/noData";
export default { export default {
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
}); });
} }
if (this.formData.idCar) { if (this.formData.idCar) {
let result = /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i.test(this.formData.idCar) let result = validateIdCard(this.formData.idCar)
if (!result) { if (!result) {
return Toast({ return Toast({
message: '请输入正确的身份证号!', message: '请输入正确的身份证号!',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment