diff --git a/src/main/java/com/lq/cms/web/IndexController.java b/src/main/java/com/lq/cms/web/IndexController.java index 600c40b..9af6c0a 100755 --- a/src/main/java/com/lq/cms/web/IndexController.java +++ b/src/main/java/com/lq/cms/web/IndexController.java @@ -22,6 +22,7 @@ import org.apache.shiro.session.Session; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; @@ -109,4 +110,12 @@ public class IndexController { return ajaxResult; } + @RequestMapping("/userEdit") + public String toUserEdit(Model model){ + Subject subject = SecurityUtils.getSubject(); + SysUser sysUser = (SysUser) subject.getPrincipal(); + model.addAttribute("sysUser",sysUser); + return "cms/main/userEdit"; + } + } diff --git a/src/main/java/com/lq/cms/web/sys/UserController.java b/src/main/java/com/lq/cms/web/sys/UserController.java index c133ca2..ac133ed 100755 --- a/src/main/java/com/lq/cms/web/sys/UserController.java +++ b/src/main/java/com/lq/cms/web/sys/UserController.java @@ -133,7 +133,6 @@ public class UserController { if (sysUser!=null&&sysUser.getId()!=null){ sysUserService.delete(sysUser.getId()); } - return ajaxResult; } @@ -145,7 +144,6 @@ public class UserController { String fileType = FileUtil.fileFormat(multipartFile.getOriginalFilename()); newFileName = "user/"+uuid.toString()+"."+fileType; File newFile = new File(FILE_LOAD_PATH +newFileName); - if (!newFile.exists()){ newFile.mkdirs(); } @@ -173,7 +171,6 @@ public class UserController { sysUserService.update(sysUser); subject.logout(); SecurityUtils.getSecurityManager().logout(subject); - }else { ajaxResult.setSuccess(false); ajaxResult.setMsg("旧密码不正确!,请重新输入."); @@ -186,4 +183,15 @@ public class UserController { } + public AjaxResult updateUser(SysUser sysUser){ + Subject subject = SecurityUtils.getSubject(); + SysUser loginUser =(SysUser)subject.getPrincipal(); + if (loginUser!=null){ + BeanUtil.copyNotNull(loginUser,sysUser); + sysUserService.update(loginUser); + } + return new AjaxResult(); + } + + } diff --git a/src/main/profile/dev/jdbc.properties b/src/main/profile/dev/jdbc.properties index cf92f01..2087517 100644 --- a/src/main/profile/dev/jdbc.properties +++ b/src/main/profile/dev/jdbc.properties @@ -1,6 +1,6 @@ #--------- jdbc 配置--------- jdbc.driver=com.mysql.jdbc.Driver -jdbc.url=jdbc:mysql://localhost:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 +jdbc.url=jdbc:mysql://192.168.31.110:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 jdbc.user=root jdbc.password=mysql #--------数据库连接池配置 ------- diff --git a/src/main/profile/dev/redis.properties b/src/main/profile/dev/redis.properties index 80be888..80de386 100644 --- a/src/main/profile/dev/redis.properties +++ b/src/main/profile/dev/redis.properties @@ -1,4 +1,4 @@ -redis.host=127.0.0.1 +redis.host=192.168.31.110 redis.port=6379 redis.pass= redis.timeout=-1 diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/main/head.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/main/head.jsp index c5c354a..7858c4f 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/main/head.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/main/head.jsp @@ -350,8 +350,30 @@ } //设置用户资料 + var iframeWin ; function setUserData() { - alert("开发中....."); + layer.open({ + id:"setUserDate", + type: 2, + area: ['380px', '400px'], + fixed: false, //不固定 + maxmin: false, + title:"编辑个人信息", + btn:["确定","取消"], + btn1:function(index){ + + var body = layer.getChildFrame('body', index); + // var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method(); + iframeWin.postDate(); + layer.close(index); + }, + btnAlign: 'c', + content: '${ctx}/cms/userEdit', + success: function(layero, index){ + iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法: + + } + }); } \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/main/userEdit.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/main/userEdit.jsp index db7c6f9..b80e851 100644 --- a/src/main/webapp/WEB-INF/views/jsp/cms/main/userEdit.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/main/userEdit.jsp @@ -6,12 +6,81 @@ To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@ include file="../../common/import-tag.jsp" %> 用户资料编辑 + + - + + + + + + + + + + + + + + + + + +
+ 用户名: + + +
+ 邮箱: + + +
+ 头像: + + + +
+ 备注: + + +
+ + + diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/edit.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/edit.jsp index d39ba67..9690965 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/edit.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/sys/user/edit.jsp @@ -4,6 +4,7 @@ 编辑 + diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/wechat/rule/index.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/wechat/rule/index.jsp index 4091fd8..8125f85 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/wechat/rule/index.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/wechat/rule/index.jsp @@ -403,7 +403,6 @@ btn:['确定','取消'], btn1:function(index,layero){ messageSet = bufferSet; - console.log(messageSet); layer.close(index); }, skin: 'layui-layer-rim', //加上边框 @@ -629,7 +628,6 @@ } function appendAlertHtml(data){ - console.log(data); var isShow ; var wechatMessageList = data.wechatMessageVoList; var html = '

图文('+data.wechatMessageCount+')

'; diff --git a/src/main/webapp/resources/code/images/uploadIcon.png b/src/main/webapp/resources/code/images/uploadIcon.png new file mode 100644 index 0000000..32675ef Binary files /dev/null and b/src/main/webapp/resources/code/images/uploadIcon.png differ diff --git a/src/main/webapp/resources/code/js/imageUtil.js b/src/main/webapp/resources/code/js/imageUtil.js new file mode 100644 index 0000000..3200f5b --- /dev/null +++ b/src/main/webapp/resources/code/js/imageUtil.js @@ -0,0 +1,12 @@ +//构建本地图片路径 +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 ; +} \ No newline at end of file