后台:可以设置固定ip属地

This commit is contained in:
luying
2022-08-04 19:33:36 +08:00
parent 0d1eb9c7b6
commit 0449983cd1
8 changed files with 22 additions and 18 deletions
+2 -2
View File
@@ -293,11 +293,11 @@ export async function getSchoolPoint(roleId: string) {
}, 0);
}
export async function setIpLocation(roleId: string, ip: string) {
export async function getIpLocation(ip: string) {
try {
const res = query.search(ip);
console.log('##### setIpLocation', res)
await RoleModel.updateRoleInfo(roleId, { ip, ipLocation: res.province||res.country })
return res.province||res.country||'未知';
} catch(e) {
console.error('setIpLocation', e)
}