mirror of
https://github.com/chillzhuang/SpringBlade.git
synced 2024-11-22 02:19:25 +08:00
🎉 2.5.2.RELEASE 增加用户个人中心
This commit is contained in:
parent
d00dee6b88
commit
a8b10d57ff
@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/badge/Release-V2.5.1-green.svg" alt="Downloads">
|
<img src="https://img.shields.io/badge/Release-V2.5.2-green.svg" alt="Downloads">
|
||||||
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
|
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
|
||||||
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
|
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
|
||||||
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR3-blue.svg" alt="Coverage Status">
|
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR3-blue.svg" alt="Coverage Status">
|
||||||
@ -65,7 +65,7 @@ SpringBlade
|
|||||||
* Archer-全能代码生成系统:[https://archer.bladex.vip](https://archer.bladex.vip)
|
* Archer-全能代码生成系统:[https://archer.bladex.vip](https://archer.bladex.vip)
|
||||||
|
|
||||||
## 技术文档
|
## 技术文档
|
||||||
* [开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
|
* [SpringBlade开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
|
||||||
* [常见问题集锦](https://sns.bladex.vip/article-14966.html)
|
* [常见问题集锦](https://sns.bladex.vip/article-14966.html)
|
||||||
|
|
||||||
## 项目地址
|
## 项目地址
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>blade-auth</artifactId>
|
<artifactId>blade-auth</artifactId>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@ package org.springblade.gateway.utils;
|
|||||||
|
|
||||||
import io.jsonwebtoken.Claims;
|
import io.jsonwebtoken.Claims;
|
||||||
import io.jsonwebtoken.Jwts;
|
import io.jsonwebtoken.Jwts;
|
||||||
|
import org.springblade.core.launch.constant.TokenConstant;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
@ -28,8 +29,8 @@ import java.util.Base64;
|
|||||||
*/
|
*/
|
||||||
public class JwtUtil {
|
public class JwtUtil {
|
||||||
|
|
||||||
public static String SIGN_KEY = "BladeX";
|
public static String SIGN_KEY = TokenConstant.SIGN_KEY;
|
||||||
public static String BEARER = "bearer";
|
public static String BEARER = TokenConstant.BEARER;
|
||||||
public static Integer AUTH_LENGTH = 7;
|
public static Integer AUTH_LENGTH = 7;
|
||||||
|
|
||||||
public static String BASE64_SECURITY = Base64.getEncoder().encodeToString(SIGN_KEY.getBytes(StandardCharsets.UTF_8));
|
public static String BASE64_SECURITY = Base64.getEncoder().encodeToString(SIGN_KEY.getBytes(StandardCharsets.UTF_8));
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -14,4 +14,6 @@ spring:
|
|||||||
boot:
|
boot:
|
||||||
admin:
|
admin:
|
||||||
discovery:
|
discovery:
|
||||||
ignored-services: consul
|
ignored-services:
|
||||||
|
- consul
|
||||||
|
- serverAddr
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ oss:
|
|||||||
enable: true
|
enable: true
|
||||||
name: qiniu
|
name: qiniu
|
||||||
tenant-mode: true
|
tenant-mode: true
|
||||||
endpoint: prt1thnw3.bkt.clouddn.com
|
endpoint: http://prt1thnw3.bkt.clouddn.com
|
||||||
access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h
|
access-key: N_Loh1ngBqcJovwiAJqR91Ifj2vgOWHOf8AwBA_h
|
||||||
secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS
|
secret-key: AuzuA1KHAbkIndCU0dB3Zfii2O3crHNODDmpxHRS
|
||||||
bucket-name: blade
|
bucket-name: blade
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -60,6 +60,10 @@ public class User extends TenantEntity {
|
|||||||
* 真名
|
* 真名
|
||||||
*/
|
*/
|
||||||
private String realName;
|
private String realName;
|
||||||
|
/**
|
||||||
|
* 头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
/**
|
/**
|
||||||
* 邮箱
|
* 邮箱
|
||||||
*/
|
*/
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<description>SpringBlade 微服务API集合</description>
|
<description>SpringBlade 微服务API集合</description>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -34,6 +34,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import springfox.documentation.annotations.ApiIgnore;
|
import springfox.documentation.annotations.ApiIgnore;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -59,6 +60,17 @@ public class UserController {
|
|||||||
return R.data(UserWrapper.build().entityVO(detail));
|
return R.data(UserWrapper.build().entityVO(detail));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询单条
|
||||||
|
*/
|
||||||
|
@ApiOperationSupport(order =2)
|
||||||
|
@ApiOperation(value = "查看详情", notes = "传入id")
|
||||||
|
@GetMapping("/info")
|
||||||
|
public R<UserVO> info(BladeUser user) {
|
||||||
|
User detail = userService.getById(user.getUserId());
|
||||||
|
return R.data(UserWrapper.build().entityVO(detail));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户列表
|
* 用户列表
|
||||||
*/
|
*/
|
||||||
@ -67,7 +79,7 @@ public class UserController {
|
|||||||
@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
|
@ApiImplicitParam(name = "account", value = "账号名", paramType = "query", dataType = "string"),
|
||||||
@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
|
@ApiImplicitParam(name = "realName", value = "姓名", paramType = "query", dataType = "string")
|
||||||
})
|
})
|
||||||
@ApiOperationSupport(order = 2)
|
@ApiOperationSupport(order = 3)
|
||||||
@ApiOperation(value = "列表", notes = "传入account和realName")
|
@ApiOperation(value = "列表", notes = "传入account和realName")
|
||||||
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
|
public R<IPage<UserVO>> list(@ApiIgnore @RequestParam Map<String, Object> user, Query query, BladeUser bladeUser) {
|
||||||
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
|
QueryWrapper<User> queryWrapper = Condition.getQueryWrapper(user, User.class);
|
||||||
@ -79,7 +91,7 @@ public class UserController {
|
|||||||
* 新增或修改
|
* 新增或修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/submit")
|
@PostMapping("/submit")
|
||||||
@ApiOperationSupport(order = 3)
|
@ApiOperationSupport(order = 4)
|
||||||
@ApiOperation(value = "新增或修改", notes = "传入User")
|
@ApiOperation(value = "新增或修改", notes = "传入User")
|
||||||
public R submit(@Valid @RequestBody User user) {
|
public R submit(@Valid @RequestBody User user) {
|
||||||
return R.status(userService.submit(user));
|
return R.status(userService.submit(user));
|
||||||
@ -89,7 +101,7 @@ public class UserController {
|
|||||||
* 修改
|
* 修改
|
||||||
*/
|
*/
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
@ApiOperationSupport(order = 4)
|
@ApiOperationSupport(order = 5)
|
||||||
@ApiOperation(value = "修改", notes = "传入User")
|
@ApiOperation(value = "修改", notes = "传入User")
|
||||||
public R update(@Valid @RequestBody User user) {
|
public R update(@Valid @RequestBody User user) {
|
||||||
return R.status(userService.updateById(user));
|
return R.status(userService.updateById(user));
|
||||||
@ -99,7 +111,7 @@ public class UserController {
|
|||||||
* 删除
|
* 删除
|
||||||
*/
|
*/
|
||||||
@PostMapping("/remove")
|
@PostMapping("/remove")
|
||||||
@ApiOperationSupport(order = 5)
|
@ApiOperationSupport(order = 6)
|
||||||
@ApiOperation(value = "删除", notes = "传入地基和")
|
@ApiOperation(value = "删除", notes = "传入地基和")
|
||||||
public R remove(@RequestParam String ids) {
|
public R remove(@RequestParam String ids) {
|
||||||
return R.status(userService.deleteLogic(Func.toIntList(ids)));
|
return R.status(userService.deleteLogic(Func.toIntList(ids)));
|
||||||
@ -114,7 +126,7 @@ public class UserController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/grant")
|
@PostMapping("/grant")
|
||||||
@ApiOperationSupport(order = 6)
|
@ApiOperationSupport(order = 7)
|
||||||
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合")
|
@ApiOperation(value = "权限设置", notes = "传入roleId集合以及menuId集合")
|
||||||
public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds,
|
public R grant(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds,
|
||||||
@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds) {
|
@ApiParam(value = "roleId集合", required = true) @RequestParam String roleIds) {
|
||||||
@ -123,11 +135,43 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/reset-password")
|
@PostMapping("/reset-password")
|
||||||
@ApiOperationSupport(order = 7)
|
@ApiOperationSupport(order = 8)
|
||||||
@ApiOperation(value = "初始化密码", notes = "传入userId集合")
|
@ApiOperation(value = "初始化密码", notes = "传入userId集合")
|
||||||
public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) {
|
public R resetPassword(@ApiParam(value = "userId集合", required = true) @RequestParam String userIds) {
|
||||||
boolean temp = userService.resetPassword(userIds);
|
boolean temp = userService.resetPassword(userIds);
|
||||||
return R.status(temp);
|
return R.status(temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
*
|
||||||
|
* @param oldPassword
|
||||||
|
* @param newPassword
|
||||||
|
* @param newPassword1
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/update-password")
|
||||||
|
@ApiOperationSupport(order = 9)
|
||||||
|
@ApiOperation(value = "修改密码", notes = "传入密码")
|
||||||
|
public R updatePassword(BladeUser user, @ApiParam(value = "旧密码", required = true) @RequestParam String oldPassword,
|
||||||
|
@ApiParam(value = "新密码", required = true) @RequestParam String newPassword,
|
||||||
|
@ApiParam(value = "新密码", required = true) @RequestParam String newPassword1) {
|
||||||
|
boolean temp = userService.updatePassword(user.getUserId(), oldPassword, newPassword, newPassword1);
|
||||||
|
return R.status(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户列表
|
||||||
|
*
|
||||||
|
* @param user
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@GetMapping("/user-list")
|
||||||
|
@ApiOperationSupport(order = 10)
|
||||||
|
@ApiOperation(value = "用户列表", notes = "传入user")
|
||||||
|
public R<List<User>> userList(User user) {
|
||||||
|
List<User> list = userService.list(Condition.getQueryWrapper(user));
|
||||||
|
return R.data(list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,17 @@ public interface IUserService extends BaseService<User> {
|
|||||||
*/
|
*/
|
||||||
boolean resetPassword(String userIds);
|
boolean resetPassword(String userIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
*
|
||||||
|
* @param userId
|
||||||
|
* @param oldPassword
|
||||||
|
* @param newPassword
|
||||||
|
* @param newPassword1
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
boolean updatePassword(Integer userId, String oldPassword, String newPassword, String newPassword1);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取角色名
|
* 获取角色名
|
||||||
*
|
*
|
||||||
|
@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.baomidou.mybatisplus.extension.exceptions.ApiException;
|
import com.baomidou.mybatisplus.extension.exceptions.ApiException;
|
||||||
import org.springblade.common.constant.CommonConstant;
|
import org.springblade.common.constant.CommonConstant;
|
||||||
|
import org.springblade.core.log.exception.ServiceException;
|
||||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||||
import org.springblade.core.tool.utils.DateUtil;
|
import org.springblade.core.tool.utils.DateUtil;
|
||||||
import org.springblade.core.tool.utils.DigestUtil;
|
import org.springblade.core.tool.utils.DigestUtil;
|
||||||
@ -96,6 +97,18 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|||||||
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toIntList(userIds)));
|
return this.update(user, Wrappers.<User>update().lambda().in(User::getId, Func.toIntList(userIds)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean updatePassword(Integer userId, String oldPassword, String newPassword, String newPassword1) {
|
||||||
|
User user = getById(userId);
|
||||||
|
if (!newPassword.equals(newPassword1)) {
|
||||||
|
throw new ServiceException("请输入正确的确认密码!");
|
||||||
|
}
|
||||||
|
if (!user.getPassword().equals(DigestUtil.encrypt(oldPassword))) {
|
||||||
|
throw new ServiceException("原密码不正确!");
|
||||||
|
}
|
||||||
|
return this.update(Wrappers.<User>update().lambda().set(User::getPassword, DigestUtil.encrypt(newPassword)).eq(User::getId, userId));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getRoleName(String roleIds) {
|
public List<String> getRoleName(String roleIds) {
|
||||||
return baseMapper.getRoleName(Func.toStrArray(roleIds));
|
return baseMapper.getRoleName(Func.toStrArray(roleIds));
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<description>SpringBlade 微服务集合</description>
|
<description>SpringBlade 微服务集合</description>
|
||||||
|
|
||||||
|
@ -73,8 +73,7 @@ blade:
|
|||||||
exclude-patterns:
|
exclude-patterns:
|
||||||
- /weixin
|
- /weixin
|
||||||
secure:
|
secure:
|
||||||
url:
|
skip-url:
|
||||||
exclude-patterns:
|
|
||||||
- /test/**
|
- /test/**
|
||||||
client:
|
client:
|
||||||
- client-id: sword
|
- client-id: sword
|
||||||
|
@ -394,6 +394,7 @@ CREATE TABLE `blade_user` (
|
|||||||
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
|
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
|
||||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
|
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
|
||||||
`real_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真名',
|
`real_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真名',
|
||||||
|
`avatar` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
|
||||||
`email` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
`email` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||||
`phone` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
|
`phone` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
|
||||||
`birthday` datetime(0) NULL DEFAULT NULL COMMENT '生日',
|
`birthday` datetime(0) NULL DEFAULT NULL COMMENT '生日',
|
||||||
@ -413,7 +414,7 @@ CREATE TABLE `blade_user` (
|
|||||||
-- Records of blade_user
|
-- Records of blade_user
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `blade_user` VALUES (1, '000000', 'admin', '90b9aa7e25f80cf4f64e990b78a9fc5ebd6cecad', '管理员', '管理员', 'admin@bladex.vip', '22233322', '2018-08-08 00:00:00', 1, '1', '1', 1, '2018-08-08 00:00:00', 1, '2018-08-08 00:00:00', 1, 0);
|
INSERT INTO `blade_user` VALUES (1, '000000', 'admin', '90b9aa7e25f80cf4f64e990b78a9fc5ebd6cecad', '管理员', '管理员', '', 'admin@bladex.vip', '22233322', '2018-08-08 00:00:00', 1, '1', '1', 1, '2018-08-08 00:00:00', 1, '2018-08-08 00:00:00', 1, 0);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
@ -394,6 +394,7 @@ CREATE TABLE `blade_user` (
|
|||||||
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
|
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '密码',
|
||||||
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
|
`name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '昵称',
|
||||||
`real_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真名',
|
`real_name` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '真名',
|
||||||
|
`avatar` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '头像',
|
||||||
`email` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
`email` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '邮箱',
|
||||||
`phone` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
|
`phone` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '手机',
|
||||||
`birthday` datetime(0) NULL DEFAULT NULL COMMENT '生日',
|
`birthday` datetime(0) NULL DEFAULT NULL COMMENT '生日',
|
||||||
@ -413,7 +414,7 @@ CREATE TABLE `blade_user` (
|
|||||||
-- Records of blade_user
|
-- Records of blade_user
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
BEGIN;
|
BEGIN;
|
||||||
INSERT INTO `blade_user` VALUES (1, '000000', 'admin', '90b9aa7e25f80cf4f64e990b78a9fc5ebd6cecad', '管理员', '管理员', 'admin@bladex.vip', '22233322', '2018-08-08 00:00:00', 1, '1', '1', 1, '2018-08-08 00:00:00', 1, '2018-08-08 00:00:00', 1, 0);
|
INSERT INTO `blade_user` VALUES (1, '000000', 'admin', '90b9aa7e25f80cf4f64e990b78a9fc5ebd6cecad', '管理员', '管理员', '', 'admin@bladex.vip', '22233322', '2018-08-08 00:00:00', 1, '1', '1', 1, '2018-08-08 00:00:00', 1, '2018-08-08 00:00:00', 1, 0);
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
SET FOREIGN_KEY_CHECKS = 1;
|
SET FOREIGN_KEY_CHECKS = 1;
|
||||||
|
2
doc/sql/blade-update-2.5.1~2.5.2.sql
Normal file
2
doc/sql/blade-update-2.5.1~2.5.2.sql
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
ALTER TABLE `blade`.`blade_user`
|
||||||
|
ADD COLUMN `avatar` varchar(2000) NULL COMMENT '头像' AFTER `real_name`;
|
6
pom.xml
6
pom.xml
@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<version>2.5.1</version>
|
<version>2.5.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<blade.tool.version>2.5.1</blade.tool.version>
|
<blade.tool.version>2.5.2</blade.tool.version>
|
||||||
<blade.project.version>2.5.1</blade.project.version>
|
<blade.project.version>2.5.2</blade.project.version>
|
||||||
|
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<swagger.version>2.9.2</swagger.version>
|
<swagger.version>2.9.2</swagger.version>
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
REGISTER=192.168.0.157/blade
|
REGISTER=192.168.0.157/blade
|
||||||
TAG=2.5.1
|
TAG=2.5.2
|
||||||
|
Loading…
Reference in New Issue
Block a user