上报地址修改

zhangshanxue 2020-07-20 01:06:39 +08:00
parent 12fd0caf99
commit 3d619ccf60
2 changed files with 16 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import com.ljsd.jieling.logic.dao.Item;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import com.ljsd.jieling.util.SysUtil;
import java.util.HashMap;
import java.util.Map;
@ -26,9 +27,9 @@ public class ReportUtil {
private static Map<Integer,ReportBaseBean> baseBeanMap = new HashMap<>();
private static ThinkingDataAnalytics ta = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(LOG_PATH));
private static ThinkingDataAnalytics ta = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(SysUtil.getPath(LOG_PATH)));
private static ThinkingDataAnalytics serverTa = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(LOG_PATH));
private static ThinkingDataAnalytics serverTa = new ThinkingDataAnalytics(new ThinkingDataAnalytics.LoggerConsumer(SysUtil.getPath(LOG_PATH)));
public static BlockingQueue<ReportUserEvent> queue = new BlockingUniqueQueue<>();

View File

@ -20,23 +20,30 @@ public class SysUtil {
}
public static String getPath(String prefixDir, String... filePath) throws IOException {
public static String getPath(String prefixDir, String... filePath) {
StringBuilder path = new StringBuilder();
path.append(getRootPath()).append(prefixDir);
for (String p : filePath) {
path.append(File.separator).append(p);
}
return path.toString();
}
public static String getRootPath() throws IOException {
public static String getRootPath() {
StringBuilder path = new StringBuilder();
if (SysUtil.isWindows()) {// Window 系统
path.append(new File(".").getCanonicalPath()).append(File.separator);
}else {
path.append("../");
try {
if (SysUtil.isWindows()) {// Window 系统
path.append(new File(".").getCanonicalPath()).append(File.separator);
}else {
path.append("../");
}
}catch (Exception e){
e.printStackTrace();
}
return path.toString();
}
public static void main(String[] args) throws IOException {