|
|
@ -45,6 +45,7 @@ async function login (ctx, next) { |
|
|
|
let ip = |
|
|
|
// '117.90.39.49' ||
|
|
|
|
ctx.ip |
|
|
|
console.log(`当前登录用户IP:${ip}`); |
|
|
|
if (ip && /^(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/.test(ip)) { |
|
|
|
const ipLocationRes = await ctx.app.fs.godRequest.post('ip', { |
|
|
|
query: { |
|
|
|