区号自动获取

This commit is contained in:
2020-11-18 09:40:56 +08:00
parent 0d6a2329d4
commit c73f45d27e
5 changed files with 39 additions and 18 deletions

View File

@@ -1022,17 +1022,22 @@ export async function getaddr() {
const res = await get<any>('ip');
const gj = res.data.address.split("|")[0];
const lan = getValue("Lanvuage");
const qh = await get<any>('countryCode', {
longitude: res.data.content.point.x,
latitude: res.data.content.point.y
});
console.log(qh)
if(lan != null && lan){
if(gj == "CN"){
return ['人民币¥'];
return {hb: '人民币¥', qh};
}else {
return [ '美元$']
return {hb: '美元$'}
}
}else{
if(gj == "CN"){
return ["zh", "中文", '人民币¥'];
return {yy: "zh", yyx: "中文", hb: '人民币¥', qh};
}else {
return ['en', 'English', '美元$']
return {yy: 'en', yyx: 'English', hb: '美元$', qh}
}
}