|
@@ -114,19 +114,21 @@ class LogModel extends BaseModel {
|
|
|
if (ip === '') {
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
if (ip === '127.0.0.1') {
|
|
|
return '服务器本机访问';
|
|
|
}
|
|
|
- let getData = {
|
|
|
- url: 'http://ip.taobao.com/service/getIpInfo.php?ip=' + ip,
|
|
|
+ let option = {
|
|
|
+ url: 'https://api01.aliyun.venuscn.com/ip?ip=' + ip,
|
|
|
encoding: 'utf8',
|
|
|
- timeout:2000
|
|
|
+ timeout:2000,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'APPCODE ' + '85c64bffe70445c4af9df7ae31c7bfcc',
|
|
|
+ }
|
|
|
};
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
try {
|
|
|
// 请求接口
|
|
|
- Request.get(getData, function (err, getResponse, body) {
|
|
|
+ Request(option, function (err, getResponse, body) {
|
|
|
if (err) {
|
|
|
//throw '请求错误';
|
|
|
resolve("请求错误");
|