将原先使用的占位图URL替换为从GlobalConfig加载的实际Logo图片,并相应地修改了createPlatformMtOption与createPlatformDyOption方法签名, 使其接收Image对象而非字符串URL。
80 lines
2.0 KiB
Java
80 lines
2.0 KiB
Java
package com.fantaibao.config;
|
|
|
|
import javafx.scene.image.Image;
|
|
import javafx.stage.Stage;
|
|
import org.springframework.util.ResourceUtils;
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.FileNotFoundException;
|
|
|
|
public class GlobalConfig {
|
|
/**
|
|
* 基础网络地址
|
|
*/
|
|
public static final String BASE_NET_URL = "http://127.0.0.1:9606";
|
|
|
|
/**
|
|
* 登录接口地址
|
|
*/
|
|
public static final String loginInterfaceAddress = BASE_NET_URL+"/user/login";
|
|
|
|
/**
|
|
* 更新cookie地址
|
|
*/
|
|
public static final String updateCookieInterfaceAddress = BASE_NET_URL+"/crawler/appraisal/update-user-cookie";
|
|
|
|
/**
|
|
* 租户Id标识
|
|
*/
|
|
public static String tenantId;
|
|
|
|
/**
|
|
* 美团点评评价接口地址
|
|
*/
|
|
public static String mtDianPingInterfaceAddress;
|
|
|
|
/**
|
|
* 美团大众点评评价接口地址
|
|
*/
|
|
public static String mtDaZhInterfaceAddress;
|
|
|
|
/**
|
|
* 抖音评价接口地址
|
|
*/
|
|
public static String dyPingJiaInterfaceAddress;
|
|
|
|
/**
|
|
* 美团登录页
|
|
*/
|
|
public static String mtLoginPage;
|
|
|
|
/**
|
|
* 抖音登录页
|
|
*/
|
|
public static String dyLoginPage;
|
|
|
|
|
|
|
|
public static final Image icon16;
|
|
public static final Image icon32;
|
|
public static final Image dyLogo;
|
|
public static final Image mtLogo;
|
|
|
|
static {
|
|
try {
|
|
icon16 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon16.png")));
|
|
icon32 = new Image(new FileInputStream(ResourceUtils.getFile("classpath:icon32.png")));
|
|
dyLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:dylogo.png")));
|
|
mtLogo = new Image(new FileInputStream(ResourceUtils.getFile("classpath:mtlogo.png")));
|
|
} catch (FileNotFoundException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
}
|
|
|
|
public static void addIcon(Stage stage) {
|
|
stage.getIcons().add(GlobalConfig.icon16);
|
|
stage.getIcons().add(GlobalConfig.icon32);
|
|
}
|
|
|
|
}
|