|
|
@@ -2,7 +2,7 @@ import CryptoJS from 'crypto-js'
|
|
|
import service from '@/services'
|
|
|
import Long from 'long'
|
|
|
import moment from 'moment'
|
|
|
-import { useGlobalStore } from '@/stores'
|
|
|
+import { useGlobalStore, useUserStore } from '@/stores'
|
|
|
|
|
|
/**
|
|
|
* 获取url对象方法
|
|
|
@@ -354,6 +354,10 @@ export function sortBy<T extends object, K extends keyof T>(arr: Array<T>, sortV
|
|
|
|
|
|
// 身份证号 获取对应的证件年龄
|
|
|
export function getIdCardAge(cardnum: string) {
|
|
|
+ /// 默认 18-60
|
|
|
+ const { getSystemParamValue } = useUserStore()
|
|
|
+ const maxAge = getSystemParamValue('325') ?? '60'
|
|
|
+ const minAge = 18
|
|
|
// 根据身份证号提取出年 月 日
|
|
|
const idYear = Number(cardnum.substring(6, 10))
|
|
|
const idMonth = Number(cardnum.substring(10, 12))
|
|
|
@@ -366,7 +370,7 @@ export function getIdCardAge(cardnum: string) {
|
|
|
let age = year - idYear
|
|
|
// 需要根据月份和具体日子判断下
|
|
|
if ((idMonth > month) || idMonth == month && idDay > day) { age-- }
|
|
|
- return age
|
|
|
+ return age < minAge || age > Number(maxAge)
|
|
|
}
|
|
|
|
|
|
// 金额转大写
|