|
|
|
@ -405,6 +405,16 @@ public class DesignUtils {
|
|
|
|
|
* @param values 参数值 |
|
|
|
|
*/ |
|
|
|
|
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values) { |
|
|
|
|
visitEnvServerByParameters(baseRoute, names, values, HttpConstants.PUBLIC); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 访问服务器环境 |
|
|
|
|
* |
|
|
|
|
* @param names 参数名字 |
|
|
|
|
* @param values 参数值 |
|
|
|
|
*/ |
|
|
|
|
public static void visitEnvServerByParameters(String baseRoute, String[] names, String[] values, String serverType) { |
|
|
|
|
int len = Math.min(ArrayUtils.getLength(names), ArrayUtils.getLength(values)); |
|
|
|
|
String[] nameValuePairs = new String[len]; |
|
|
|
|
for (int i = 0; i < len; i++) { |
|
|
|
@ -417,10 +427,9 @@ public class DesignUtils {
|
|
|
|
|
"=" + CommonCodeUtils.encodeURIComponent(CommonCodeUtils.encodeURIComponent(value)); |
|
|
|
|
} |
|
|
|
|
String postfixOfUri = (nameValuePairs.length > 0 ? "?" + StableUtils.join(nameValuePairs, "&") : StringUtils.EMPTY); |
|
|
|
|
|
|
|
|
|
if (!WorkContext.getCurrent().isLocal()) { |
|
|
|
|
try { |
|
|
|
|
String urlPath = getWebBrowserPath(); |
|
|
|
|
String urlPath = getWebBrowserPath(serverType); |
|
|
|
|
Desktop.getDesktop().browse(new URI(urlPath + baseRoute + postfixOfUri)); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
FineLoggerFactory.getLogger().error("cannot open the url Successful", e); |
|
|
|
@ -437,8 +446,8 @@ public class DesignUtils {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static String getWebBrowserPath() { |
|
|
|
|
String urlPath = WorkContext.getCurrent().getPath() + HttpConstants.PUBLIC; |
|
|
|
|
private static String getWebBrowserPath(String serverPath) { |
|
|
|
|
String urlPath = WorkContext.getCurrent().getPath() + serverPath; |
|
|
|
|
DesignerEnvProcessor processor = ExtraDesignClassManager.getInstance().getSingle(DesignerEnvProcessor.XML_TAG); |
|
|
|
|
if (processor != null) { |
|
|
|
|
//cas访问的时候, url要处理下.
|
|
|
|
|