若依开源1.1.2发布

master
RuoYi 6 years ago committed by Limy
parent 88677ad34a
commit ab47c3c38b

@ -5,8 +5,8 @@
<groupId>com.ruoyi</groupId> <groupId>com.ruoyi</groupId>
<artifactId>RuoYi</artifactId> <artifactId>RuoYi</artifactId>
<version>1.1.1</version> <version>1.1.2</version>
<packaging>war</packaging> <packaging>jar</packaging>
<name>RuoYi</name> <name>RuoYi</name>
<description>若依管理系统</description> <description>若依管理系统</description>
@ -43,12 +43,14 @@
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
<!--
<exclusions> <exclusions>
<exclusion> <exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId> <artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
</exclusion> </exclusion>
</exclusions> </exclusions>
-->
</dependency> </dependency>
<!-- SpringBoot 测试 --> <!-- SpringBoot 测试 -->

@ -25,10 +25,10 @@ insert into sys_dept values(100, 0, '若依集团', 0, '马云', '15011112221
insert into sys_dept values(101, 100, '研发部门', 1, '马研', '15011112222', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(101, 100, '研发部门', 1, '马研', '15011112222', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(102, 100, '市场部门', 2, '马市', '15011112223', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(102, 100, '市场部门', 2, '马市', '15011112223', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(103, 100, '测试部门', 3, '马测', '15011112224', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(103, 100, '测试部门', 3, '马测', '15011112224', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(104, 100, '财务部门', 4, '马财', '15011112225', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(104, 100, '财务部门', 4, '马财', '15011112225', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(105, 100, '运维部门', 5, '马运', '15011112226', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(105, 100, '运维部门', 5, '马运', '15011112226', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(106, 101, '研发一部', 1, '马一', '15011112227', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(106, 101, '研发一部', 1, '马一', '15011112227', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(107, 101, '研发二部', 2, '马二', '15011112228', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(107, 101, '研发二部', 2, '马二', '15011112228', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(108, 102, '市场一部', 1, '马一', '15011112229', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(108, 102, '市场一部', 1, '马一', '15011112229', 'ry@qq.com', 0, 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_dept values(109, 102, '市场二部', 2, '马二', '15011112210', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_dept values(109, 102, '市场二部', 2, '马二', '15011112210', 'ry@qq.com', 1, 'admin', '2018-03-01', 'ry', '2018-03-01');
@ -61,8 +61,8 @@ create table sys_user (
-- ---------------------------- -- ----------------------------
-- 初始化-用户信息表数据 -- 初始化-用户信息表数据
-- ---------------------------- -- ----------------------------
insert into sys_user values(1, 106, 'admin', '若依', 'yzz_ivy@163.com', '15088888888', '0', 'img/a5.jpg', '29c67a30398638269fe600f73a054934', '111111', 'N', 1, '维护中', 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_user values(1, 106, 'admin', '若依', 'yzz_ivy@163.com', '15088888888', '0', 'img/a5.jpg', '29c67a30398638269fe600f73a054934', '111111', 'N', 0, '维护中', 'admin', '2018-03-01', 'ry', '2018-03-01');
insert into sys_user values(2, 108, 'ry', '若依', 'ry@163.com', '15288888888', '1', 'img/a5.jpg', '8e6d98b90472783cc73c17047ddccf36', '222222', 'N', 1, '锁定中', 'admin', '2018-03-01', 'ry', '2018-03-01'); insert into sys_user values(2, 108, 'ry', '若依', 'ry@163.com', '15288888888', '1', 'img/a5.jpg', '8e6d98b90472783cc73c17047ddccf36', '222222', 'N', 0, '锁定中', 'admin', '2018-03-01', 'ry', '2018-03-01');
-- ---------------------------- -- ----------------------------

@ -1,6 +1,8 @@
package com.ruoyi.common.utils.security; package com.ruoyi.common.utils.security;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.SimplePrincipalCollection;
import org.apache.shiro.subject.Subject; import org.apache.shiro.subject.Subject;
import com.ruoyi.project.system.user.domain.User; import com.ruoyi.project.system.user.domain.User;
@ -28,6 +30,16 @@ public class ShiroUtils
return (User) getSubjct().getPrincipal(); return (User) getSubjct().getPrincipal();
} }
public static void setUser(User user)
{
Subject subject = getSubjct();
PrincipalCollection principalCollection = subject.getPrincipals();
String realmName = principalCollection.getRealmNames().iterator().next();
PrincipalCollection newPrincipalCollection = new SimplePrincipalCollection(user, realmName);
// 重新加载Principal
subject.runAs(newPrincipalCollection);
}
public static Long getUserId() public static Long getUserId()
{ {
return getUser().getUserId().longValue(); return getUser().getUserId().longValue();

@ -59,6 +59,11 @@ public class BaseController
return ShiroUtils.getUser(); return ShiroUtils.getUser();
} }
public void setUser(User user)
{
ShiroUtils.setUser(user);
}
public Long getUserId() public Long getUserId()
{ {
return getUser().getUserId(); return getUser().getUserId();

@ -0,0 +1,119 @@
package com.ruoyi.project.system.user.controller;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.Message;
import com.ruoyi.project.system.user.domain.User;
import com.ruoyi.project.system.user.service.IUserService;
/**
*
*
* @author ruoyi
*/
@Controller
@RequestMapping("/system/user/profile")
public class ProfileController extends BaseController
{
private String prefix = "system/user/profile";
@Autowired
private IUserService userService;
/**
*
*/
@GetMapping()
public String profile(Model model)
{
User user = getUser();
String sex = user.getSex();
if ("0".equals(sex))
{
user.setSex("性别:男");
}
else if ("1".equals(sex))
{
user.setSex("性别:女");
}
String roleGroup = userService.selectUserRoleGroup(user.getUserId());
String postGroup = userService.selectUserPostGroup(user.getUserId());
model.addAttribute("user", user);
model.addAttribute("roleGroup", roleGroup);
model.addAttribute("postGroup", postGroup);
return prefix + "/profile";
}
@RequestMapping("/checkPassword")
@ResponseBody
public boolean checkPassword(String password)
{
User user = getUser();
String encrypt = new Md5Hash(user.getLoginName() + password + user.getSalt()).toHex().toString();
if (user.getPassword().equals(encrypt))
{
return true;
}
return false;
}
@Log(title = "系统管理", action = "个人信息-重置密码")
@GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, Model model)
{
User user = userService.selectUserById(userId);
model.addAttribute("user", user);
return prefix + "/resetPwd";
}
@Log(title = "系统管理", action = "个人信息-重置密码")
@PostMapping("/resetPwd")
@ResponseBody
public Message resetPwd(User user)
{
int rows = userService.resetUserPwd(user);
if (rows > 0)
{
setUser(userService.selectUserById(user.getUserId()));
return Message.ok();
}
return Message.error();
}
/**
*
*/
@Log(title = "系统管理", action = "个人信息-修改用户")
@GetMapping("/edit/{userId}")
public String edit(@PathVariable("userId") Long userId, Model model)
{
User user = userService.selectUserById(userId);
model.addAttribute("user", user);
return prefix + "/edit";
}
/**
*
*/
@Log(title = "系统管理", action = "个人信息-保存用户")
@PostMapping("/update")
@ResponseBody
public Message update(User user)
{
if (userService.updateUser(user) > 0)
{
setUser(userService.selectUserById(user.getUserId()));
return Message.ok();
}
return Message.error();
}
}

@ -109,7 +109,7 @@ public class UserController extends BaseController
@ResponseBody @ResponseBody
public Message resetPwd(User user) public Message resetPwd(User user)
{ {
int rows = userService.updateUser(user); int rows = userService.resetUserPwd(user);
if (rows > 0) if (rows > 0)
{ {
return Message.ok(); return Message.ok();
@ -152,10 +152,10 @@ public class UserController extends BaseController
} }
/** /**
* *
*/ */
@RequiresPermissions("system:user:save") @RequiresPermissions("system:user:save")
@Log(title = "系统管理", action = "部门管理-保存部门") @Log(title = "系统管理", action = "用户管理-保存用户")
@PostMapping("/save") @PostMapping("/save")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ResponseBody @ResponseBody
@ -183,28 +183,4 @@ public class UserController extends BaseController
return uniqueFlag; return uniqueFlag;
} }
/**
*
*/
@GetMapping("/profile")
public String profile(Model model)
{
User user = getUser();
String sex = user.getSex();
if ("0".equals(sex))
{
user.setSex("性别:男");
}
else if ("1".equals(sex))
{
user.setSex("性别:女");
}
String roleGroup = userService.selectUserRoleGroup(user.getUserId());
String postGroup = userService.selectUserPostGroup(user.getUserId());
model.addAttribute("user", user);
model.addAttribute("roleGroup", roleGroup);
model.addAttribute("postGroup", postGroup);
return prefix + "/profile";
}
} }

@ -67,6 +67,14 @@ public interface IUserService
*/ */
public int updateUser(User user); public int updateUser(User user);
/**
*
*
* @param user
* @return
*/
public int resetUserPwd(User user);
/** /**
* *
* *

@ -162,8 +162,19 @@ public class UserServiceImpl implements IUserService
* @param user * @param user
* @return * @return
*/ */
@Override
public int updateUser(User user) public int updateUser(User user)
{
return userDao.updateUser(user);
}
/**
*
*
* @param user
* @return
*/
@Override
public int resetUserPwd(User user)
{ {
user.randomSalt(); user.randomSalt();
user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt())); user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));

@ -1,7 +1,7 @@
# 项目名称、版本、版权年份 # 项目名称、版本、版权年份
ruoyi: ruoyi:
name: RuoYi name: RuoYi
version: 1.1.1 version: 1.1.2
copyrightYear: 2018 copyrightYear: 2018
#开发环境配置 #开发环境配置

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

@ -1,5 +1,5 @@
/*! /*!
* ruoyi.css v1.1.1 * ruoyi.css
* Author: Ruoyi * Author: Ruoyi
*/ */

@ -5,7 +5,7 @@ $("#form-dept-add").validate({
remote: { remote: {
url: ctx + "system/dept/checkDeptNameUnique", url: ctx + "system/dept/checkDeptNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"deptName" : function() { "deptName" : function() {
return $("input[name='deptName']").val(); return $("input[name='deptName']").val();

@ -5,7 +5,7 @@ $("#form-dept-edit").validate({
remote: { remote: {
url: ctx + "system/dept/checkDeptNameUnique", url: ctx + "system/dept/checkDeptNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"deptId": function() { "deptId": function() {
return $("input[name='deptId']").val(); return $("input[name='deptId']").val();

@ -9,7 +9,7 @@ $("#form-dict-add").validate({
remote: { remote: {
url: ctx + "system/dict/checkDictTypeUnique", url: ctx + "system/dict/checkDictTypeUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
name : function() { name : function() {
return $.trim($("#dictType").val()); return $.trim($("#dictType").val());

@ -9,7 +9,7 @@ $("#form-dict-edit").validate({
remote: { remote: {
url: ctx + "system/dict/checkDictTypeUnique", url: ctx + "system/dict/checkDictTypeUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
dictId : function() { dictId : function() {
return $.trim($("#dictId").val()); return $.trim($("#dictId").val());

@ -5,7 +5,7 @@ $("#form-menu-add").validate({
remote: { remote: {
url: ctx + "system/menu/checkMenuNameUnique", url: ctx + "system/menu/checkMenuNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"menuName" : function() { "menuName" : function() {
return $.trim($("#menuName").val()); return $.trim($("#menuName").val());

@ -10,7 +10,7 @@ $("#form-menu-edit").validate({
remote: { remote: {
url: ctx + "system/menu/checkMenuNameUnique", url: ctx + "system/menu/checkMenuNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"menuId": function() { "menuId": function() {
return $("input[name='menuId']").val(); return $("input[name='menuId']").val();

@ -23,7 +23,7 @@ $("#form-role-add").validate({
remote: { remote: {
url: ctx + "system/role/checkRoleNameUnique", url: ctx + "system/role/checkRoleNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"roleName" : function() { "roleName" : function() {
return $.trim($("#roleName").val()); return $.trim($("#roleName").val());

@ -23,7 +23,7 @@ $("#form-role-edit").validate({
remote: { remote: {
url: ctx + "system/role/checkRoleNameUnique", url: ctx + "system/role/checkRoleNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
"roleId": function() { "roleId": function() {
return $("input[name='roleId']").val(); return $("input[name='roleId']").val();

@ -6,7 +6,7 @@ $("#form-user-add").validate({
remote: { remote: {
url: ctx + "system/user/checkUserNameUnique", url: ctx + "system/user/checkUserNameUnique",
type: "post", type: "post",
dataType: "text", dataType: "json",
data: { data: {
name : function() { name : function() {
return $.trim($("#loginName").val()); return $.trim($("#loginName").val());

@ -33,8 +33,8 @@
<script src="../static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js}"></script> <script src="../static/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/bootstrap-table-export.js}"></script>
<script src="../static/ajax/libs/bootstrap-table/extensions/export/tableExport.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script> <script src="../static/ajax/libs/bootstrap-table/extensions/export/tableExport.js" th:src="@{/ajax/libs/bootstrap-table/extensions/export/tableExport.js}"></script>
<script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script> <script src="../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../static/ruoyi/js/common.js?v=1.1.1" th:src="@{/ruoyi/js/common.js?v=1.1.1}"></script> <script src="../static/ruoyi/js/common.js?v=1.1.2" th:src="@{/ruoyi/js/common.js?v=1.1.2}"></script>
<script src="../static/ruoyi/js/ry-ui.js?v=1.1.1" th:src="@{/ruoyi/js/ry-ui.js?v=1.1.1}"></script> <script src="../static/ruoyi/js/ry-ui.js?v=1.1.2" th:src="@{/ruoyi/js/ry-ui.js?v=1.1.2}"></script>
<script th:inline="javascript"> var ctx = [[@{/}]]; </script> <script th:inline="javascript"> var ctx = [[@{/}]]; </script>
<script src="http://tajs.qq.com/stats?sId=62048022"></script> <script src="http://tajs.qq.com/stats?sId=62048022"></script>
</div> </div>

@ -45,8 +45,8 @@
<a class="btn btn-success btn-outline" href="https://gitee.com/y_project/RuoYi" target="_blank"> <a class="btn btn-success btn-outline" href="https://gitee.com/y_project/RuoYi" target="_blank">
<i class="fa fa-cloud"> </i> 访问码云 <i class="fa fa-cloud"> </i> 访问码云
</a> </a>
<a class="btn btn-white btn-bitbucket" href="https://www.oschina.net/p/ruoyi" target="_blank"> <a class="btn btn-white btn-bitbucket" href="http://ruoyi.club/" target="_blank">
<i class="fa fa-home"></i> 访问博客 <i class="fa fa-home"></i> 访问主页
</a> </a>
</p> </p>
</div> </div>
@ -94,13 +94,35 @@
<div class="ibox-content no-padding"> <div class="ibox-content no-padding">
<div class="panel-body"> <div class="panel-body">
<div class="panel-group" id="version"> <div class="panel-group" id="version">
<div class="panel panel-default">
<div class="panel-heading">
<h5 class="panel-title">
<a data-toggle="collapse" data-parent="#version" href="#v11">v1.1.2</a><code class="pull-right">2018.05.07</code>
</h5>
</div>
<div id="v11" class="panel-collapse collapse in">
<div class="panel-body">
<ol>
<li>新增个人信息修改</li>
<li>菜单存在子菜单不允许删除</li>
<li>菜单分配角色不允许删除</li>
<li>角色分配人员不允许删除</li>
<li>岗位使用后不允许删除</li>
<li>保证用户的数据完整性加入事物</li>
<li>新增环境使用手册、数据建模</li>
<li>Thymeleaf升级到3.0</li>
<li>支持非ROOT部署</li>
</ol>
</div>
</div>
</div>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
<h5 class="panel-title"> <h5 class="panel-title">
<a data-toggle="collapse" data-parent="#version" href="#v11">v1.1.1</a><code class="pull-right">2018.04.23</code> <a data-toggle="collapse" data-parent="#version" href="#v11">v1.1.1</a><code class="pull-right">2018.04.23</code>
</h5> </h5>
</div> </div>
<div id="v11" class="panel-collapse collapse in"> <div id="v11" class="panel-collapse collapse">
<div class="panel-body"> <div class="panel-body">
<ol> <ol>
<li>新增表单构建器</li> <li>新增表单构建器</li>

@ -0,0 +1,90 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-edit">
<input name="userId" type="hidden" th:value="${user.userId}" />
<div class="form-group">
<label class="col-sm-3 control-label ">登录名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" readonly="true" th:value="${user.loginName}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">部门名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" readonly="true" th:value="${user.dept.deptName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">用户名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="userName" id="userName" th:value="${user.userName}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">邮箱:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="email" th:value="${user.email}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">手机:</label>
<div class="col-sm-8">
<input class="form-control" type="text" name="phonenumber" id="phonenumber" th:value="${user.phonenumber}">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">性别:</label>
<div class="col-sm-8">
<div class="radio radio-info radio-inline">
<input type="radio" id="radio1" th:field="*{user.sex}" name="sex" value="0">
<label for="radio1"></label>
</div>
<div class="radio radio-danger radio-inline">
<input type="radio" id="radio2" th:field="*{user.sex}" name="sex" value="1">
<label for="radio2"></label>
</div>
</div>
</div>
<div class="form-group">
<div class="form-control-static col-sm-offset-9">
<button type="submit" class="btn btn-primary">提交</button>
<button th:onclick="'javascript:layer_close()'" class="btn btn-danger" type="button">关闭</button>
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script>
$("#form-user-edit").validate({
rules:{
userName:{
required:true,
},
password:{
required:true,
minlength: 6
},
email:{
required:true,
email:true
},
phonenumber:{
required:true,
},
},
submitHandler:function(form){
update();
}
});
function update() {
_ajax_save(ctx + "system/user/profile/update", $("#form-user-edit").serialize());
}
</script>
</body>
</html>

@ -25,9 +25,8 @@
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
</a> </a>
<ul class="dropdown-menu dropdown-user"> <ul class="dropdown-menu dropdown-user">
<li><a href="javascript:editProfile()">修改信息</a></li> <li><a href="javascript:edit()">修改信息</a></li>
<li><a href="javascript:editHead()">修改头像</a></li> <li><a href="javascript:resetPwd()">修改密码</a></li>
<li><a href="javascript:editPasswod()">修改密码</a></li>
</ul> </ul>
</div> </div>
@ -35,7 +34,7 @@
<div class="contact-box"> <div class="contact-box">
<div class="col-sm-4"> <div class="col-sm-4">
<div class="text-center"> <div class="text-center">
<img alt="image" class="img-circle m-t-xs img-responsive" src="/img/a5.jpg"> <img alt="image" class="img-circle m-t-xs img-responsive" src="/img/profilel.jpg">
<div class="m-t-xs font-bold">CEO</div> <div class="m-t-xs font-bold">CEO</div>
</div> </div>
</div> </div>
@ -60,17 +59,14 @@
<script> <script>
var userId = [[${user.userId}]]; var userId = [[${user.userId}]];
/*用户信息-修改*/ /*用户信息-修改*/
function editProfile() { function edit() {
var url = ctx + "system/user/edit/" + userId; var url = ctx + "system/user/profile/edit/" + userId;
layer_showAuto("修改用户", url); layer_showAuto("修改用户", url);
} }
/*用户头像-修改*/ /*用户管理-重置密码*/
function editHead() { function resetPwd() {
$.modalAlert("敬请期待", "success"); var url = ctx + 'system/user/profile/resetPwd/' + userId;
} layer_show("重置密码", url, '800', '500');
/*用户密码-修改*/
function editPasswod() {
$.modalAlert("敬请期待", "success");
} }
</script> </script>
</body> </body>

@ -0,0 +1,113 @@
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-user-resetPwd">
<input name="userId" type="hidden" th:value="${user.userId}" />
<div class="form-group">
<label class="col-sm-3 control-label ">登录名称:</label>
<div class="col-sm-8">
<input class="form-control" type="text" readonly="true" name="loginName" th:value="${user.loginName}"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">旧密码:</label>
<div class="col-sm-8">
<input class="form-control" type="password" name="oldPassword" id="oldPassword">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">新密码:</label>
<div class="col-sm-8">
<input class="form-control" type="password" name="password" id="password">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">再次确认:</label>
<div class="col-sm-8">
<input class="form-control" type="password" name="confirm" id="confirm">
</div>
</div>
<div class="form-group">
<div class="form-control-static col-sm-offset-9">
<button type="submit" class="btn btn-primary">提交</button>
<button th:onclick="'javascript:layer_close()'" class="btn btn-danger" type="button">关闭</button>
</div>
</div>
</form>
</div>
<div th:include="include :: footer"></div>
<script>
$("#form-user-resetPwd").validate({
rules:{
oldPassword:{
required:true,
minlength: 6,
remote: {
url: ctx + "system/user/profile/checkPassword",
type: "get",
dataType: "json",
data: {
password: function() {
return $("input[name='oldPassword']").val();
}
}
}
},
password: {
required: true,
minlength: 6
},
confirm: {
required: true,
equalTo: "#password"
}
},
messages: {
oldPassword: {
required: "请输入原密码",
remote: "原密码错误"
},
password: {
required: "请输入新密码",
minlength: "密码不能小于6个字符"
},
confirm: {
required: "请再次输入新密码",
equalTo: "两次密码输入不一致"
}
},
submitHandler:function(form){
resetPwd();
}
});
function resetPwd() {
$.ajax({
cache : true,
type : "post",
url : ctx + "system/user/profile/resetPwd",
data : $('#form-user-resetPwd').serialize(),
async : false,
error : function(request) {
parent.layer.alert("系统错误");
},
success : function(data) {
if (data.code == 0) {
parent.layer.msg("修改成功,正在刷新数据请稍后……",{icon:1,time: 500,shade: [0.1,'#fff']},function(){
window.parent.location.reload();
});
} else {
parent.layer.alert(data.m , {icon: 2,title:"系统提示"});
}
}
});
}
</script>
</body>
</html>
Loading…
Cancel
Save