master
星期八 6 years ago
parent d9539c7c8c
commit 8cc8990191
  1. 2
      src/main/java/com/lq/cms/web/AdminBaseController.java
  2. 23
      src/main/java/com/lq/code/util/HttpsClient.java
  3. 36
      src/main/webapp/WEB-INF/views/jsp/cms/sys/user/edit.jsp
  4. 2
      src/main/webapp/WEB-INF/views/jsp/cms/sys/user/index.jsp
  5. 5
      ssm.iml

@ -33,7 +33,7 @@ public abstract class AdminBaseController<T,V extends AdminBaseVo> {
* 管理后台url用于权限控制
* @return
*/
public abstract String getIndexUrl();
public abstract String getIndexUrl();
public Map<String,Object> setPageDate(V vo){
Map<String,Object> map=new HashMap();

@ -27,7 +27,9 @@ import org.apache.http.impl.client.HttpClients;
import com.alibaba.fastjson.JSONObject;
public class HttpsClient {
public static String post(String url,Map<String, Object> params) throws IOException{
String boundary = getBoundaryStr();
CloseableHttpResponse reponse =null;
@ -141,15 +143,16 @@ public class HttpsClient {
}
private static SSLContext getTrustAllSSLContext() throws Exception {
SSLContext context = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
@Override
public boolean isTrusted(X509Certificate[] arg0, String arg1)
throws java.security.cert.CertificateException {
// 这一句就是信任任何的证书,当然你也可以去验证服务器的真实性
return true;
}
}).build();
// SSLContext context = SSLContexts.custom().loadTrustMaterial(null, new TrustStrategy() {
//
// @Override
// public boolean isTrusted(X509Certificate[] arg0, String arg1)
// throws java.security.cert.CertificateException {
// // 这一句就是信任任何的证书,当然你也可以去验证服务器的真实性
// return true;
// }
// }).build();
SSLContext context = SSLContext.getDefault();
return context;
}

@ -6,8 +6,35 @@
<title>编辑</title>
<script type="text/javascript">
$(function () {
$("#image_td").hide();
$("#menuIco").val('${sysResource.menuIco}');
})
$('#file').change(function () {
var imgPath = getObjectURL(this.files[0]);
$("#imageShow").attr("src",imgPath);
$("#image_td").show();
});
var userImageUrl = '${sysUser.imgUrl}';
console.log(userImageUrl);
if (userImageUrl!=null&&userImageUrl!=''){
$("#imageShow").attr("src",'${ctx}/loadFile/'+userImageUrl);
$("#image_td").show();
}
});
//构建本地图片路径
function getObjectURL(file) {
var url = null ;
if (window.createObjectURL!=undefined) {
url = window.createObjectURL(file) ;
} else if (window.URL!=undefined) {
url = window.URL.createObjectURL(file) ;
} else if (window.webkitURL!=undefined) {
url = window.webkitURL.createObjectURL(file) ;
}
return url ;
}
</script>
</head>
@ -34,10 +61,15 @@
<td><input class="easyui-textbox" type="text" id="email" data-options="multiline:true,required:true" value="${sysUser.email}" ></input></td>
</tr>
<tr>
<tr >
<td>头像:</td>
<td><input type="file" name="file" id="file" data-options="multiline:true,required:true" ></input></td>
</tr>
<tr id="image_td">
<td colspan="2" align="center">
<img src="" id="imageShow" width="100" height="100">
</td>
</tr>
<tr>
<td>备注:</td>

@ -49,7 +49,7 @@
iconCls: 'icon-add',
handler: function(){openEdit('新增',null)}
}]
})
});
});
</script>
</head>

@ -10,10 +10,6 @@
<root url="file://$MODULE_DIR$/lib" relative="WEB-INF/lib" />
<root url="file://$MODULE_DIR$/src/main/webapp" relative="/" />
</webroots>
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources/dev" />
</sourceRoots>
</configuration>
</facet>
<facet type="Spring" name="Spring">
@ -26,7 +22,6 @@
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources/dev" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />

Loading…
Cancel
Save