From 01e40a62f9b8afe0230935b69385a05f2ce38058 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 11 Sep 2019 14:23:22 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/profile/dev/jdbc.properties | 2 +- src/main/profile/dev/redis.properties | 2 +- src/main/profile/pro/file.properties | 2 +- src/main/profile/pro/jdbc.properties | 2 +- src/main/profile/pro/redis.properties | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/profile/dev/jdbc.properties b/src/main/profile/dev/jdbc.properties index 2087517..8741005 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://192.168.31.110:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 +jdbc.url=jdbc:mysql://192.168.31.19: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 80de386..b61b6af 100644 --- a/src/main/profile/dev/redis.properties +++ b/src/main/profile/dev/redis.properties @@ -1,4 +1,4 @@ -redis.host=192.168.31.110 +redis.host=192.168.31.19 redis.port=6379 redis.pass= redis.timeout=-1 diff --git a/src/main/profile/pro/file.properties b/src/main/profile/pro/file.properties index 70c8c53..6c6a3a8 100644 --- a/src/main/profile/pro/file.properties +++ b/src/main/profile/pro/file.properties @@ -1 +1 @@ -file.upload=/Users/qi/java/fileManger/ \ No newline at end of file +file.upload=/home/nfs/fileManger/ \ No newline at end of file diff --git a/src/main/profile/pro/jdbc.properties b/src/main/profile/pro/jdbc.properties index cf92f01..8741005 100644 --- a/src/main/profile/pro/jdbc.properties +++ b/src/main/profile/pro/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.19:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 jdbc.user=root jdbc.password=mysql #--------数据库连接池配置 ------- diff --git a/src/main/profile/pro/redis.properties b/src/main/profile/pro/redis.properties index 80be888..b61b6af 100644 --- a/src/main/profile/pro/redis.properties +++ b/src/main/profile/pro/redis.properties @@ -1,4 +1,4 @@ -redis.host=127.0.0.1 +redis.host=192.168.31.19 redis.port=6379 redis.pass= redis.timeout=-1 From c2b7ba0835bc4b65c8da27b6012e18a0c8f15ec5 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 11 Sep 2019 14:24:19 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=99=BB=E9=99=86=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9=E8=87=AA?= =?UTF-8?q?=E5=B7=B1=E8=B5=84=E6=96=99=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/lq/cms/web/sys/UserController.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) 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 ac133ed..08436e2 100755 --- a/src/main/java/com/lq/cms/web/sys/UserController.java +++ b/src/main/java/com/lq/cms/web/sys/UserController.java @@ -8,11 +8,17 @@ import com.lq.cms.service.SysUserService; import com.lq.cms.vo.SysUserRoleVo; import com.lq.cms.vo.SysUserVo; import com.lq.code.entity.AjaxResult; +import com.lq.code.interceptor.shiro.ShiroRealm; import com.lq.code.util.*; import com.lq.entity.SysUser; import org.apache.log4j.Logger; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.apache.shiro.cache.Cache; +import org.apache.shiro.mgt.RealmSecurityManager; +import org.apache.shiro.subject.PrincipalCollection; +import org.apache.shiro.subject.SimplePrincipalCollection; import org.apache.shiro.subject.Subject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -182,15 +188,28 @@ public class UserController { return ajaxResult; } - - public AjaxResult updateUser(SysUser sysUser){ + @RequestMapping("/updateUser") + @ResponseBody + public AjaxResult updateUser(SysUser sysUser,@RequestParam(value = "uploadFile",required = false) MultipartFile uploadFile){ Subject subject = SecurityUtils.getSubject(); SysUser loginUser =(SysUser)subject.getPrincipal(); if (loginUser!=null){ BeanUtil.copyNotNull(loginUser,sysUser); + String uploadFileName =upLoadFile(uploadFile); + loginUser.setUpdateTime(new Date()); + if (StringUtil.isNotNull(uploadFileName)) { + loginUser.setImgUrl(uploadFileName); + } sysUserService.update(loginUser); + RealmSecurityManager securityManager = (RealmSecurityManager) SecurityUtils.getSecurityManager(); + PrincipalCollection principalCollection = subject.getPrincipals(); + String realName = principalCollection.getRealmNames().iterator().next(); + PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(loginUser,realName); + subject.runAs(newPrincipalCollection); } - return new AjaxResult(); + AjaxResult ajaxResult = new AjaxResult(); + ajaxResult.setData(loginUser); + return ajaxResult; } From 6e5ca2136f527441d8445805ce8d3288739c99d8 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 11 Sep 2019 14:25:48 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java b/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java index f271a58..b415b08 100755 --- a/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java +++ b/src/main/java/com/lq/code/interceptor/shiro/ShiroRealm.java @@ -87,7 +87,6 @@ public class ShiroRealm extends AuthorizingRealm { sysUser.setLastLoginTime(new Date()); sysUserService.update(sysUser); String realmName=this.getName(); - // Object principal= token.getPrincipal(); return new SimpleAuthenticationInfo(sysUser,password,realmName); } } From 3601c8cdf15413eba56106891df7716d3662e766 Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 11 Sep 2019 14:26:28 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/java/com/lq/BaseTest.java | 2 +- src/test/java/com/lq/SysPermissionServiceTest.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/lq/BaseTest.java b/src/test/java/com/lq/BaseTest.java index 47dcc8c..b008928 100644 --- a/src/test/java/com/lq/BaseTest.java +++ b/src/test/java/com/lq/BaseTest.java @@ -6,5 +6,5 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(value = {"/spring-mybatis-config.xml","/spring-import.xml"}) -public class BaseTest { +public abstract class BaseTest { } diff --git a/src/test/java/com/lq/SysPermissionServiceTest.java b/src/test/java/com/lq/SysPermissionServiceTest.java index 0de49a1..7b97624 100644 --- a/src/test/java/com/lq/SysPermissionServiceTest.java +++ b/src/test/java/com/lq/SysPermissionServiceTest.java @@ -16,7 +16,6 @@ import java.util.Date; import java.util.List; import java.util.Map; - public class SysPermissionServiceTest extends BaseTest { @Autowired @@ -27,6 +26,10 @@ public class SysPermissionServiceTest extends BaseTest { private SysResourceDao sysResourceDao; @Test + public void test1(){ + + } + public void test(){ //1.查询所有菜单 From 8de4b4e3bb5a02fa35ec1eaf5e82ea618ee0167e Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 11 Sep 2019 14:27:02 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=89=8D=E7=AB=AF-=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=99=BB=E9=99=86=E7=94=A8=E6=88=B7=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/jsp/cms/main/userEdit.jsp | 27 ++++++++++++++----- 1 file changed, 21 insertions(+), 6 deletions(-) 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 b80e851..8cb5c77 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 @@ -33,7 +33,7 @@ 用户名: - + @@ -41,7 +41,7 @@ 邮箱: - + @@ -52,21 +52,22 @@ - + 备注: - - + + + From 05466b135686b3761a1d520c22bb83388aa46aae Mon Sep 17 00:00:00 2001 From: qi_liang Date: Mon, 16 Sep 2019 13:43:31 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E5=89=8D=E7=AB=AF-=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=99=BB=E9=99=86=E7=94=A8=E6=88=B7=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/lq/cms/web/sys/UserController.java | 2 +- src/main/profile/dev/jdbc.properties | 2 +- src/main/profile/dev/redis.properties | 2 +- src/main/webapp/WEB-INF/views/jsp/cms/login.jsp | 2 +- src/main/webapp/WEB-INF/views/jsp/cms/main/head.jsp | 11 ++++++++--- 5 files changed, 12 insertions(+), 7 deletions(-) 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 08436e2..433b2e6 100755 --- a/src/main/java/com/lq/cms/web/sys/UserController.java +++ b/src/main/java/com/lq/cms/web/sys/UserController.java @@ -143,7 +143,7 @@ public class UserController { } //内部方法 ,上传文件,并返回文件路径 - private String upLoadFile(MultipartFile multipartFile){ + final private String upLoadFile(MultipartFile multipartFile){ String newFileName = null; if (multipartFile!=null && multipartFile.getSize()>0){ UUID uuid = UUID.randomUUID(); diff --git a/src/main/profile/dev/jdbc.properties b/src/main/profile/dev/jdbc.properties index 8741005..cf92f01 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://192.168.31.19:3306/ssm?useUnicode=true&characterEncoding=UTF-8&characterSetResults=UTF-8 +jdbc.url=jdbc:mysql://localhost: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 b61b6af..9b38d93 100644 --- a/src/main/profile/dev/redis.properties +++ b/src/main/profile/dev/redis.properties @@ -1,4 +1,4 @@ -redis.host=192.168.31.19 +redis.host=localhost redis.port=6379 redis.pass= redis.timeout=-1 diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/login.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/login.jsp index 4036cbc..5ca4392 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/login.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/login.jsp @@ -52,7 +52,7 @@

- cms + ssm 管理后台应用

© 星期八

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 7858c4f..be29c6a 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 @@ -32,7 +32,7 @@
-
+
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 be29c6a..71bb332 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 @@ -25,7 +25,7 @@ - ACE后台管理系统 + ssm后台管理系统 @@ -256,13 +256,13 @@