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" %>
+ 用户名: + | ++ + | +
+ 邮箱: + | ++ + | +
+ 头像: + | ++ + + | +
+ 备注: + | ++ + | +