提交 7341f899 编写于 作者: Z zhangxin10

修复授权文件的配置可以根据不同的选项可以支持各种网络环境,目前可以在界面上进行选择

上级 d6f49bc9
......@@ -37,10 +37,9 @@ public class AuthFileCtl {
@RequestMapping("/exportAuth/{appCode}")
public void exportApplicationAuthFile(HttpServletRequest request, HttpServletResponse response,
@PathVariable("appCode") String appCode) throws Exception {
@PathVariable("appCode") String appCode, String authType) throws Exception {
HttpSession session = request.getSession();
String uid = (String) session.getAttribute("uid");
JSONObject reJson = new JSONObject();
if (StringUtil.isBlank(uid)) {
......@@ -56,7 +55,7 @@ public class AuthFileCtl {
java.net.URLEncoder.encode(fileName, "utf-8");
response.addHeader("Content-Disposition",
"attachment;" + "filename=\"" + URLEncoder.encode(fileName, "utf-8") + "\"");
Properties properties = authFileSer.queryAuthFile();
Properties properties = authFileSer.queryAuthFile(authType);
String propertyValue;
for (Map.Entry<Object, Object> value : properties.entrySet()) {
propertyValue = String.valueOf(value.getValue());
......
......@@ -21,14 +21,14 @@ public class AuthConfigMDAO implements IAuthConfigMDAO {
private static Logger logger = LogManager.getLogger(AuthConfigMDAO.class);
@Override
public Properties queryAllAuthConfig() {
public Properties queryAllAuthConfig(final String authType) {
final Properties properties = new Properties();
String sql = "select auth_file_config.key, auth_file_config.value from auth_file_config where auth_file_config.sts = ? ";
String sql = "select auth_file_config.key, auth_file_config.value" + authType + " from auth_file_config where auth_file_config.sts = ? ";
final Object[] params = new Object[]{"A"};
jdbcTemplate.query(sql, params,new RowCallbackHandler() {
jdbcTemplate.query(sql, params, new RowCallbackHandler() {
@Override
public void processRow(ResultSet resultSet) throws SQLException {
properties.setProperty(resultSet.getString("key"), resultSet.getString("value"));
properties.setProperty(resultSet.getString("key"), resultSet.getString("value" + authType));
}
});
return properties;
......
......@@ -3,5 +3,5 @@ package com.ai.cloud.dao.inter;
import java.util.Properties;
public interface IAuthConfigMDAO {
Properties queryAllAuthConfig();
Properties queryAllAuthConfig(String authType);
}
......@@ -14,7 +14,7 @@ public class AuthFileSerImpl implements IAuthFileSer {
private IAuthConfigMDAO authConfigMDAO;
@Override
public Properties queryAuthFile() {
return authConfigMDAO.queryAllAuthConfig();
public Properties queryAuthFile(String authType) {
return authConfigMDAO.queryAllAuthConfig(authType);
}
}
......@@ -3,5 +3,5 @@ package com.ai.cloud.service.inter;
import java.util.Properties;
public interface IAuthFileSer {
Properties queryAuthFile();
Properties queryAuthFile(String authType);
}
......@@ -98,6 +98,15 @@
<input type="text" class="form-control" id="exclusiveException" placeholder="java.lang.Exception,java.io.IOException">
</div>
</div>
<div class="form-group">
<label for="period" class="col-sm-4 control-label">授权文件类型:</label>
<div class="col-sm-4">
<select class="form-control" id="authType">
<option value="1">外网</option>
<option value="0">内网</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-4">
<input type='hidden' id="authAppCode">
......@@ -488,9 +497,14 @@
exclusiveException.attr("type","hidden");
exclusiveException.attr("name","exclusiveException");
exclusiveException.attr("value",$("#exclusiveException").val());
var authType=$("<input>");
authType.attr("type","hidden");
authType.attr("name","authType");
authType.attr("value",$("#authType").val());
$("#authFiledownLoad").append(form);//将表单放置在web中
form.append(exportData);
form.append(exclusiveException);
form.append(authType);
form.submit();//表单提交
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册