|
@@ -162,8 +162,9 @@ export function searchkey(cityName){
|
|
|
}
|
|
}
|
|
|
//身份证地址识别
|
|
//身份证地址识别
|
|
|
export function addressCode(address){
|
|
export function addressCode(address){
|
|
|
- let rule=/.+?(省|市|自治区|自治州|县|区|城|旗|域|岛|院|划|街道)/g;
|
|
|
|
|
|
|
+ let rule= /.+?(省|市|自治区|自治州|县|区)/g;
|
|
|
const targetValues=address.match(rule)
|
|
const targetValues=address.match(rule)
|
|
|
|
|
+ // console.log(targetValues)
|
|
|
const matchedKeys = [];
|
|
const matchedKeys = [];
|
|
|
for (const key in codeToText) {
|
|
for (const key in codeToText) {
|
|
|
const value = codeToText[key];
|
|
const value = codeToText[key];
|
|
@@ -171,6 +172,7 @@ export function addressCode(address){
|
|
|
matchedKeys.push(key)
|
|
matchedKeys.push(key)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // console.log(matchedKeys)
|
|
|
const cityValues = [];
|
|
const cityValues = [];
|
|
|
if(matchedKeys.length<3 && matchedKeys.length!=0){
|
|
if(matchedKeys.length<3 && matchedKeys.length!=0){
|
|
|
let unknown=matchedKeys[1].length==6?'true' : "false";
|
|
let unknown=matchedKeys[1].length==6?'true' : "false";
|