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