优化ip获取 日志过滤请求返回参数
This commit is contained in:
@@ -198,7 +198,7 @@
|
||||
n.note_id,
|
||||
n.note_title,
|
||||
n.follow_id,
|
||||
a.author_name,
|
||||
a.author_name followName,
|
||||
a.AVATAR_URL,
|
||||
n.create_time,
|
||||
b.FIRST_PICTURE, CASE
|
||||
|
@@ -29,7 +29,7 @@
|
||||
|
||||
<select id="selectOperationLogPage" resultType="com.dd.admin.business.operationLog.domain.OperationLogVo">
|
||||
select
|
||||
*
|
||||
OPER_ID,OPER_MODULE,OPER_TYPE,OPER_DESC,OPER_METHOD,OPER_USER_ID,OPER_USER_NAME,OPER_IP,OPER_URL,OPER_DEPT_ID,OPER_DEPT_NAME,CREATE_TIME,MEMBER_ID,MEMBER_NAME,OPER_IP_ADDRESS,MESSAGE_STATUS
|
||||
from business_operation_log where 1 = 1
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
@@ -25,10 +25,13 @@ public class AddressUtils {
|
||||
String rspStr = RegionUtil.getRegion(ip);
|
||||
if (StringUtils.isNotEmpty(rspStr)) {
|
||||
String[] obj = rspStr.split("\\|");
|
||||
String country = obj[0];
|
||||
String region = obj[2];
|
||||
String city = obj[3];
|
||||
if("0".equals(city)){
|
||||
return String.format("%s", region);
|
||||
} if("0".equals(region)){
|
||||
return String.format("%s", country);
|
||||
}
|
||||
return String.format("%s", city);
|
||||
}
|
||||
@@ -75,7 +78,7 @@ public class AddressUtils {
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
String realAddress = getRealAddress("103.85.74.92");
|
||||
String realAddress = getRealAddress("23.142.200.80");
|
||||
;
|
||||
System.out.println("realAddress = " + realAddress);
|
||||
}
|
||||
|
@@ -2,7 +2,6 @@ package com.dd.admin.common.utils;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.sun.javaws.Main;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
Reference in New Issue
Block a user