Compare commits
132 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
167baed952 | ||
![]() |
8dc40224cc | ||
![]() |
252b218c42 | ||
![]() |
9be08aae63 | ||
![]() |
121fd0652d | ||
![]() |
9882142a46 | ||
![]() |
822f4e8192 | ||
![]() |
4efb6c0847 | ||
![]() |
8eba07c736 | ||
![]() |
9a9f7058ae | ||
![]() |
bcceac5df2 | ||
![]() |
38614abe76 | ||
![]() |
f56450c6b7 | ||
![]() |
f7268e7ce4 | ||
![]() |
fe552aedcd | ||
![]() |
a3e8ee2b41 | ||
![]() |
7d367c367c | ||
![]() |
9724a522e9 | ||
![]() |
ca4290204c | ||
![]() |
fff6fedcfa | ||
![]() |
1bebd5ef8e | ||
![]() |
8e0415a8fe | ||
![]() |
5036971f55 | ||
![]() |
d3c5906cfa | ||
![]() |
cfd8cd57cf | ||
![]() |
fad3a030e9 | ||
![]() |
02a0ab6d6d | ||
![]() |
fee6d00ecf | ||
![]() |
b72aa7b268 | ||
![]() |
38ac5270d6 | ||
![]() |
433056d5ea | ||
![]() |
250c56f90c | ||
![]() |
c0380aaf6a | ||
![]() |
eda8418797 | ||
![]() |
69dba93ae5 | ||
![]() |
3d09088029 | ||
![]() |
1b2dc570de | ||
![]() |
f564137f05 | ||
![]() |
63900da8c2 | ||
![]() |
170c0dbcfc | ||
![]() |
9626b5e971 | ||
![]() |
e1e749d8a4 | ||
![]() |
5856c93035 | ||
![]() |
f749b9db06 | ||
![]() |
5e959d310a | ||
![]() |
c414e0eb62 | ||
![]() |
2ce2287146 | ||
![]() |
9edf88b37a | ||
![]() |
7e31efcfe2 | ||
![]() |
ab420e4120 | ||
![]() |
7b7f285034 | ||
![]() |
46056a16b4 | ||
![]() |
f34f28f576 | ||
![]() |
f1f602c131 | ||
![]() |
f736e0a1c4 | ||
![]() |
969f9d0327 | ||
![]() |
2579e8549e | ||
![]() |
ba74c587b7 | ||
![]() |
fc3aa2047c | ||
![]() |
ec378d75de | ||
![]() |
e03a1a8bb3 | ||
![]() |
78fe38d687 | ||
![]() |
a6b70491e3 | ||
![]() |
8b31b65ac1 | ||
![]() |
bc400cf646 | ||
![]() |
4f5964f287 | ||
![]() |
3cb7aba37e | ||
![]() |
c844c7ef19 | ||
![]() |
b267b2c347 | ||
![]() |
08a35704e9 | ||
![]() |
986d1328e0 | ||
![]() |
4a8129bffa | ||
![]() |
833ac54a2f | ||
![]() |
7bf9a85263 | ||
![]() |
7df42db2e2 | ||
![]() |
e3c31c353a | ||
![]() |
c06a96b768 | ||
![]() |
e7d0024eb0 | ||
![]() |
d44d4da428 | ||
![]() |
471175b406 | ||
![]() |
62cc1206f7 | ||
![]() |
a7a98d153c | ||
![]() |
41c6aa9147 | ||
![]() |
63b7ee096a | ||
![]() |
cff4391f2d | ||
![]() |
a7feb9279f | ||
![]() |
4bf5b04d54 | ||
![]() |
c5fad966d2 | ||
![]() |
1cc2e09185 | ||
![]() |
1467ab6530 | ||
![]() |
3ac2b9973c | ||
![]() |
053007ef9e | ||
![]() |
33d8dbef45 | ||
![]() |
30f160446e | ||
![]() |
4f770b24a4 | ||
![]() |
bc41aa70d1 | ||
![]() |
f540c8a37c | ||
![]() |
20e34e35a3 | ||
![]() |
cfcc2c6762 | ||
![]() |
fe0886d122 | ||
![]() |
de4df784ea | ||
![]() |
b1d42becc3 | ||
![]() |
878a0ef638 | ||
![]() |
c0bebb7755 | ||
![]() |
32ccb8bd84 | ||
![]() |
4c169cbc58 | ||
![]() |
0d1a8c627b | ||
![]() |
5dcf763f08 | ||
![]() |
fcbb99941c | ||
![]() |
efcff7333e | ||
![]() |
128ee67925 | ||
![]() |
28cb66b971 | ||
![]() |
bfe7cf01eb | ||
![]() |
5e43efc555 | ||
![]() |
67df00264a | ||
![]() |
424ddb23e4 | ||
![]() |
2cef84bdc8 | ||
![]() |
152453106a | ||
![]() |
55d8977108 | ||
![]() |
3f19760678 | ||
![]() |
cd42846bec | ||
![]() |
855bb214be | ||
![]() |
f0395c450f | ||
![]() |
5151112912 | ||
![]() |
37ec560687 | ||
![]() |
f966fae060 | ||
![]() |
fd4adf2cea | ||
![]() |
2bc45ad467 | ||
![]() |
c671c23e87 | ||
![]() |
d5c35c23dc | ||
![]() |
09d0634694 | ||
![]() |
1044e1ac72 |
30
.github/workflows/maven.yml
vendored
Normal file
30
.github/workflows/maven.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Java CI with Maven
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
# pull_request:
|
||||
# branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '8', '11', '17' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ matrix.Java }}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{ matrix.java }}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
|
51
.github/workflows/yudao-ui-admin.yml
vendored
Normal file
51
.github/workflows/yudao-ui-admin.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: yudao-ui-admin CI
|
||||
|
||||
# 在master分支发生push事件时触发。
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
# pull_request:
|
||||
# branches: [ master ]
|
||||
env: # 设置环境变量
|
||||
TZ: Asia/Shanghai # 时区(设置时区可使页面中的`最近更新时间`使用时区时间)
|
||||
WORK_DIR: yudao-ui-admin #工作目录
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: yudao-ui-admin
|
||||
|
||||
jobs:
|
||||
build: # 自定义名称
|
||||
runs-on: ubuntu-latest # 运行在虚拟机环境ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x, 16.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- name: Checkout # 步骤1
|
||||
uses: actions/checkout@v2 # 使用的动作。格式:userName/repoName。作用:检出仓库,获取源码。 官方actions库:https://github.com/actions
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2.0.1
|
||||
with:
|
||||
version: 6.15.1
|
||||
|
||||
- name: Set node version to ${{ matrix.node_version }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
cache: "pnpm"
|
||||
cache-dependency-path: yudao-ui-admin/pnpm-lock.yaml
|
||||
|
||||
- name: Install deps
|
||||
run: pnpm install
|
||||
|
||||
- name: Build
|
||||
run: pnpm run build:prod
|
||||
|
||||
# 查看 workflow 的文档来获取更多信息
|
||||
# @see https://github.com/crazy-max/ghaction-github-pages
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -43,3 +43,5 @@ nbdist/
|
||||
!*/build/*.html
|
||||
!*/build/*.xml
|
||||
|
||||
### JRebel ###
|
||||
rebel.xml
|
||||
|
16
README.md
16
README.md
@@ -1,4 +1,4 @@
|
||||
## 平台简介
|
||||
## 🐯 平台简介
|
||||
|
||||
**芋道**,一套**全部开源**的**企业级**的快速开发平台,毫无保留给个人及企业免费使用。
|
||||
|
||||
@@ -13,7 +13,13 @@
|
||||
* 集成微信小程序、微信公众号、企业微信、钉钉等三方登陆,集成支付宝、微信等支付与退款。
|
||||
* 集成阿里云、腾讯云、云片等短信渠道,集成阿里云、腾讯云、七牛云等云存储服务。
|
||||
|
||||
## 在线体验
|
||||
| 项目名 | 说明 | 传说门 |
|
||||
| ---- | ---- | ---- |
|
||||
| `ruoyi-vue-pro` | Spring Boot 版本 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)** [Github](https://github.com/YunaiV/ruoyi-vue-pro) |
|
||||
| `ruoyi-vue-cloud` | Spring Cloud 版本 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-cloud)** [Github](https://github.com/YunaiV/onemall) |
|
||||
| `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)** [Github](https://github.com/YunaiV/SpringBoot-Labs) |
|
||||
|
||||
## 🐶 在线体验
|
||||
|
||||
演示地址:<http://dashboard.yudao.iocoder.cn>
|
||||
* 账号密码:admin/admin123
|
||||
@@ -23,7 +29,7 @@
|
||||
|
||||
> 未来会补充文档和视频,方便胖友冲冲冲!
|
||||
|
||||
## 内置功能
|
||||
## 🐼 内置功能
|
||||
|
||||
分成多种内置功能:
|
||||
* 系统功能
|
||||
@@ -121,7 +127,7 @@ ps:核心功能已经实现,正在对接微信小程序中...
|
||||
| 🚀 | 数据库文档 | 基于 Screw 自动生成数据库文档,支持导出 Word、HTML、MD 格式 |
|
||||
| | 表单构建 | 拖动表单元素生成相应的 HTML 代码,支持导出 JSON、Vue 文件 |
|
||||
|
||||
## 技术栈
|
||||
## 🐨 技术栈
|
||||
|
||||
| 项目 | 说明 |
|
||||
|-----------------------|--------------------|
|
||||
@@ -170,7 +176,7 @@ ps:核心功能已经实现,正在对接微信小程序中...
|
||||
| [Vue](https://cn.vuejs.org/index.html) | JavaScript 框架 | 2.6.12 |
|
||||
| [Vue Element Admin](https://ant.design/docs/react/introduce-cn) | 后台前端解决方案 | - |
|
||||
|
||||
## 演示图
|
||||
## 🐷 演示图
|
||||
|
||||
### 系统功能
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
config.stopBubbling = true
|
||||
lombok.tostring.callsuper=true
|
||||
lombok.equalsandhashcode.callsuper=true
|
||||
lombok.tostring.callsuper=CALL
|
||||
lombok.equalsandhashcode.callsuper=CALL
|
||||
lombok.accessors.chain=true
|
||||
|
4
pom.xml
4
pom.xml
@@ -21,12 +21,12 @@
|
||||
<module>yudao-module-pay</module>
|
||||
</modules>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>芋道项目基础脚手架</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>1.4.0-snapshot</revision>
|
||||
<revision>1.5.0-snapshot</revision>
|
||||
<!-- Maven 相关 -->
|
||||
<java.version>1.8</java.version>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
|
File diff suppressed because one or more lines are too long
@@ -9,12 +9,12 @@
|
||||
<version>${revision}</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>基础 bom 文件,管理整个项目的依赖版本</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
<properties>
|
||||
<revision>1.4.0-snapshot</revision>
|
||||
<revision>1.5.0-snapshot</revision>
|
||||
<!-- 统一依赖管理 -->
|
||||
<spring.boot.version>2.5.9</spring.boot.version>
|
||||
<!-- Web 相关 -->
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-common</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>定义基础 pojo 类、枚举、工具类等等</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
@@ -89,11 +89,6 @@
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
|
@@ -2,11 +2,13 @@ package cn.iocoder.yudao.framework.common.util.json;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.experimental.UtilityClass;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
@@ -17,6 +19,8 @@ import java.util.List;
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@UtilityClass
|
||||
@Slf4j
|
||||
public class JsonUtils {
|
||||
|
||||
private static ObjectMapper objectMapper = new ObjectMapper();
|
||||
@@ -36,29 +40,26 @@ public class JsonUtils {
|
||||
JsonUtils.objectMapper = objectMapper;
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static String toJsonString(Object object) {
|
||||
try {
|
||||
return objectMapper.writeValueAsString(object);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return objectMapper.writeValueAsString(object);
|
||||
}
|
||||
|
||||
@SneakyThrows
|
||||
public static byte[] toJsonByte(Object object) {
|
||||
try {
|
||||
return objectMapper.writeValueAsBytes(object);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return objectMapper.writeValueAsBytes(object);
|
||||
}
|
||||
|
||||
|
||||
public static <T> T parseObject(String text, Class<T> clazz) {
|
||||
if (StrUtil.isEmpty(text)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return objectMapper.readValue(text, clazz);
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -67,9 +68,11 @@ public class JsonUtils {
|
||||
if (ArrayUtil.isEmpty(bytes)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
return objectMapper.readValue(bytes, clazz);
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", bytes, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -78,6 +81,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readValue(text, typeReference);
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -86,9 +90,11 @@ public class JsonUtils {
|
||||
if (StrUtil.isEmpty(text)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
try {
|
||||
return objectMapper.readValue(text, objectMapper.getTypeFactory().constructCollectionType(List.class, clazz));
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -98,6 +104,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readTree(text);
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
@@ -106,6 +113,7 @@ public class JsonUtils {
|
||||
try {
|
||||
return objectMapper.readTree(text);
|
||||
} catch (IOException e) {
|
||||
log.error("json parse err,json:{}", text, e);
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
@@ -1,8 +1,13 @@
|
||||
package cn.iocoder.yudao.framework.common.util.validation;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.validation.ConstraintViolation;
|
||||
import javax.validation.ConstraintViolationException;
|
||||
import javax.validation.Validator;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
@@ -34,4 +39,11 @@ public class ValidationUtils {
|
||||
&& PATTERN_XML_NCNAME.matcher(str).matches();
|
||||
}
|
||||
|
||||
public static void validate(Validator validator, Object reqVO, Class<?>... groups) {
|
||||
Set<ConstraintViolation<Object>> constraintViolations = validator.validate(reqVO, groups);
|
||||
if (CollUtil.isNotEmpty(constraintViolations)) {
|
||||
throw new ConstraintViolationException(constraintViolations);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-activiti</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Activiti 拓展</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-data-permission</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>数据权限</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>字典类型、数据</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>操作日志</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -6,13 +6,13 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.servlet.ServletUtil;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.service.OperateLogFrameworkService;
|
||||
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
|
||||
import com.google.common.collect.Maps;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -23,6 +23,7 @@ import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.aspectj.lang.reflect.MethodSignature;
|
||||
import org.springframework.core.annotation.AnnotationUtils;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@@ -356,7 +357,8 @@ public class OperateLogAspect {
|
||||
// obj
|
||||
return object instanceof MultipartFile
|
||||
|| object instanceof HttpServletRequest
|
||||
|| object instanceof HttpServletResponse;
|
||||
|| object instanceof HttpServletResponse
|
||||
|| object instanceof BindingResult;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-spring-boot-starter-biz-pay</artifactId>
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>支付拓展,接入国内多个支付渠道
|
||||
1. 支付宝,基于官方 SDK 接入
|
||||
2. 微信支付,基于 weixin-java-pay 接入
|
||||
|
@@ -27,6 +27,7 @@ public interface PayClientConfig {
|
||||
*/
|
||||
Set<ConstraintViolation<PayClientConfig>> verifyParam(Validator validator);
|
||||
|
||||
// TODO @aquan:貌似抽象一个 validation group 就好了!
|
||||
/**
|
||||
* 参数校验
|
||||
*
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-sms</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>短信拓展,支持阿里云、云片</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>yudao-spring-boot-starter-biz-social</artifactId>
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>多租户</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-biz-weixin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>微信拓展
|
||||
1. 基于 weixin-java-mp 库,对接微信公众号平台。目前主要解决微信公众号的支付场景。
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-config</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>配置中心,基于 Apollo 魔改实现</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Excel 拓展</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-extension</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>扩展点组件</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>任务拓展
|
||||
1. 定时任务,基于 Quartz 拓展
|
||||
2. 异步任务,基于 Spring Async 拓展
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-monitor</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>服务监控,提供链路追踪、日志服务、指标收集等等功能</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>消息队列,基于 Redis Pub/Sub 实现广播消费,基于 Stream 实现集群消费</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -18,6 +18,7 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||
import org.springframework.data.redis.listener.ChannelTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
import org.springframework.data.redis.stream.DefaultStreamMessageListenerContainerX;
|
||||
import org.springframework.data.redis.stream.StreamMessageListenerContainer;
|
||||
|
||||
import java.util.List;
|
||||
@@ -81,11 +82,12 @@ public class YudaoMQAutoConfiguration {
|
||||
.build();
|
||||
// 创建 container 对象
|
||||
StreamMessageListenerContainer<String, ObjectRecord<String, String>> container =
|
||||
StreamMessageListenerContainer.create(redisTemplate.getRequiredConnectionFactory(), containerOptions);
|
||||
// StreamMessageListenerContainer.create(redisTemplate.getRequiredConnectionFactory(), containerOptions);
|
||||
DefaultStreamMessageListenerContainerX.create(redisMQTemplate.getRedisTemplate().getRequiredConnectionFactory(), containerOptions);
|
||||
|
||||
// 第二步,注册监听器,消费对应的 Stream 主题
|
||||
String consumerName = buildConsumerName();
|
||||
listeners.forEach(listener -> {
|
||||
listeners.parallelStream().forEach(listener -> {
|
||||
// 创建 listener 对应的消费者分组
|
||||
try {
|
||||
redisTemplate.opsForStream().createGroup(listener.getStreamKey(), listener.getGroup());
|
||||
|
@@ -0,0 +1,62 @@
|
||||
package org.springframework.data.redis.stream;
|
||||
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.stream.ByteRecord;
|
||||
import org.springframework.data.redis.connection.stream.ReadOffset;
|
||||
import org.springframework.data.redis.connection.stream.Record;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 拓展 DefaultStreamMessageListenerContainer 实现,解决 Spring Data Redis + Redisson 结合使用时,Redisson 在 Stream 获得不到数据时,返回 null 而不是空 List,导致 NPE 异常。
|
||||
* 对应 issue:https://github.com/spring-projects/spring-data-redis/issues/2147 和 https://github.com/redisson/redisson/issues/4006
|
||||
* 目前看下来 Spring Data Redis 不肯加 null 判断,Redisson 暂时也没改返回 null 到空 List 的打算,所以暂时只能自己改,哽咽!
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public class DefaultStreamMessageListenerContainerX<K, V extends Record<K, ?>> extends DefaultStreamMessageListenerContainer<K, V> {
|
||||
|
||||
/**
|
||||
* 参考 {@link StreamMessageListenerContainer#create(RedisConnectionFactory, StreamMessageListenerContainerOptions)} 的实现
|
||||
*/
|
||||
public static <K, V extends Record<K, ?>> StreamMessageListenerContainer<K, V> create(RedisConnectionFactory connectionFactory, StreamMessageListenerContainer.StreamMessageListenerContainerOptions<K, V> options) {
|
||||
Assert.notNull(connectionFactory, "RedisConnectionFactory must not be null!");
|
||||
Assert.notNull(options, "StreamMessageListenerContainerOptions must not be null!");
|
||||
return new DefaultStreamMessageListenerContainerX<>(connectionFactory, options);
|
||||
}
|
||||
|
||||
public DefaultStreamMessageListenerContainerX(RedisConnectionFactory connectionFactory, StreamMessageListenerContainerOptions<K, V> containerOptions) {
|
||||
super(connectionFactory, containerOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参考 {@link DefaultStreamMessageListenerContainer#register(StreamReadRequest, StreamListener)} 的实现
|
||||
*/
|
||||
@Override
|
||||
public Subscription register(StreamReadRequest<K> streamRequest, StreamListener<K, V> listener) {
|
||||
return this.doRegisterX(getReadTaskX(streamRequest, listener));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private StreamPollTask<K, V> getReadTaskX(StreamReadRequest<K> streamRequest, StreamListener<K, V> listener) {
|
||||
StreamPollTask<K, V> task = ReflectUtil.invoke(this, "getReadTask", streamRequest, listener);
|
||||
// 修改 readFunction 方法
|
||||
Function<ReadOffset, List<ByteRecord>> readFunction = (Function<ReadOffset, List<ByteRecord>>) ReflectUtil.getFieldValue(task, "readFunction");
|
||||
ReflectUtil.setFieldValue(task, "readFunction", (Function<ReadOffset, List<ByteRecord>>) readOffset -> {
|
||||
List<ByteRecord> records = readFunction.apply(readOffset);
|
||||
//【重点】保证 records 不是空,避免 NPE 的问题!!!
|
||||
return records != null ? records : Collections.emptyList();
|
||||
});
|
||||
return task;
|
||||
}
|
||||
|
||||
private Subscription doRegisterX(Task task) {
|
||||
return ReflectUtil.invoke(this, "doRegister", task);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>数据库连接池、多数据源、事务、MyBatis 拓展</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-protection</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>服务保证,提供分布式锁、幂等、限流、熔断等等功能</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-redis</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>Redis 封装拓展</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>用户的认证、权限的校验</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>测试组件,用于单元测试、集成测试</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>用户的认证、权限的校验</description>
|
||||
<url>https://github.com/YunaiV/ruoyi-vue-pro</url>
|
||||
|
||||
|
@@ -46,17 +46,22 @@ public class CacheRequestBodyWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener readListener) {}
|
||||
|
||||
@Override
|
||||
public int available() {
|
||||
return body.length;
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
<artifactId>yudao-module-bpm</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
bpm 包下,业务流程管理(Business Process Management),我们放工作流的功能。
|
||||
例如说:流程定义、表单配置、审核中心(我的申请、我的待办、我的已办)等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
bpm 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-bpm-base</artifactId>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
bpm-base 模块,实现公用的工作流的逻辑,提供给 bpm-activiti 和 bpm-flowable 复用
|
||||
</description>
|
||||
|
@@ -21,7 +21,7 @@ public class BpmMessageSendWhenTaskCreatedReqDTO {
|
||||
*/
|
||||
@NotEmpty(message = "流程实例的名字不能为空")
|
||||
private String processInstanceName;
|
||||
@NotEmpty(message = "发起人的用户编号")
|
||||
@NotNull(message = "发起人的用户编号")
|
||||
private Long startUserId;
|
||||
@NotEmpty(message = "发起人的昵称")
|
||||
private String startUserNickname;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-bpm-impl-activiti</artifactId>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
bpm-activiti 模块,基于 Activiti 7 实现工作流
|
||||
</description>
|
||||
|
@@ -73,7 +73,8 @@ public interface BpmTaskConvert {
|
||||
@Mappings({
|
||||
@Mapping(source = "id", target = "taskId"),
|
||||
@Mapping(source = "assignee", target = "assigneeUserId"),
|
||||
@Mapping(source = "createdDate", target = "createTime")
|
||||
@Mapping(source = "createdDate", target = "createTime"),
|
||||
@Mapping(target = "id", ignore = true)
|
||||
})
|
||||
BpmTaskExtDO convert(org.activiti.api.task.model.Task bean);
|
||||
|
||||
@@ -104,6 +105,7 @@ public interface BpmTaskConvert {
|
||||
BpmTaskRespVO convert3(HistoricTaskInstance bean);
|
||||
BpmTaskRespVO.User convert3(AdminUserRespDTO bean);
|
||||
|
||||
@Mapping(target = "id", ignore = true)
|
||||
void copyTo(BpmTaskExtDO from, @MappingTarget BpmTaskDonePageItemRespVO to);
|
||||
|
||||
@Mappings({
|
||||
|
@@ -10,7 +10,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-bpm-impl-flowable</artifactId>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
bpm-flowable 模块,基于 Flowable 6 实现工作流
|
||||
</description>
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<artifactId>yudao-module-infra</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
infra 包下,我们放基础设施的运维与管理,支撑上层的通用与核心业务。
|
||||
例如说:定时任务的管理、服务器的信息等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
infra 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-infra-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
infra 模块,我们放基础设施的运维与管理,支撑上层的通用与核心业务。
|
||||
例如说:定时任务的管理、服务器的信息等等
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<artifactId>yudao-module-member</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
member 模块,我们放会员业务。
|
||||
例如说:会员中心等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-member-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
member 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-member-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
member 模块,我们放会员业务。
|
||||
例如说:会员中心等等
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<module>yudao-module-pay-impl</module>
|
||||
</modules>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
pay 模块,我们放支付业务,提供业务的支付能力。
|
||||
例如说:商户、应用、支付、退款等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-pay-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
pay 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-pay-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
pay 模块,我们放支付业务,提供业务的支付能力。
|
||||
例如说:商户、应用、支付、退款等等
|
||||
|
@@ -7,6 +7,7 @@ import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@ApiModel("用户 APP - 退款订单 Req VO")
|
||||
@Data
|
||||
@@ -15,11 +16,11 @@ import javax.validation.constraints.NotEmpty;
|
||||
public class AppPayRefundReqVO {
|
||||
|
||||
@ApiModelProperty(value = "支付订单编号自增", required = true, example = "10")
|
||||
@NotEmpty(message = "支付订单编号自增")
|
||||
@NotNull(message = "支付订单编号自增")
|
||||
private Long payOrderId;
|
||||
|
||||
@ApiModelProperty(value = "退款金额", required = true, example = "1")
|
||||
@NotEmpty(message = "退款金额")
|
||||
@NotNull(message = "退款金额")
|
||||
private Long amount;
|
||||
|
||||
@ApiModelProperty(value = "退款原因", required = true, example = "不喜欢")
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<artifactId>yudao-module-system</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
system 模块下,我们放通用业务,支撑上层的核心业务。
|
||||
例如说:用户、部门、权限、数据字典等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
system 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-system-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
system 模块下,我们放通用业务,支撑上层的核心业务。
|
||||
例如说:用户、部门、权限、数据字典等等
|
||||
|
@@ -10,6 +10,16 @@ tenant-id: {{adminTenentId}}
|
||||
"code": "1024"
|
||||
}
|
||||
|
||||
### 请求 /login 接口 => 成功(无验证码)
|
||||
POST {{baseUrl}}/system/login
|
||||
Content-Type: application/json
|
||||
tenant-id: {{adminTenentId}}
|
||||
|
||||
{
|
||||
"username": "admin",
|
||||
"password": "admin123"
|
||||
}
|
||||
|
||||
### 请求 /get-permission-info 接口 => 成功
|
||||
GET {{baseUrl}}/system/get-permission-info
|
||||
Authorization: Bearer {{token}}
|
||||
|
@@ -29,12 +29,17 @@ public class AuthLoginReqVO {
|
||||
@Length(min = 4, max = 16, message = "密码长度为 4-16 位")
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "验证码", required = true, example = "1024")
|
||||
@NotEmpty(message = "验证码不能为空")
|
||||
@ApiModelProperty(value = "验证码", required = true, example = "1024", notes = "验证码开启时,需要传递")
|
||||
@NotEmpty(message = "验证码不能为空", groups = CodeEnableGroup.class)
|
||||
private String code;
|
||||
|
||||
@ApiModelProperty(value = "验证码的唯一标识", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62")
|
||||
@NotEmpty(message = "唯一标识不能为空")
|
||||
@ApiModelProperty(value = "验证码的唯一标识", required = true, example = "9b2ffbc1-7425-4155-9894-9d5c08541d62", notes = "验证码开启时,需要传递")
|
||||
@NotEmpty(message = "唯一标识不能为空", groups = CodeEnableGroup.class)
|
||||
private String uuid;
|
||||
|
||||
/**
|
||||
* 开启验证码的 Group
|
||||
*/
|
||||
public interface CodeEnableGroup {}
|
||||
|
||||
}
|
||||
|
@@ -14,11 +14,14 @@ import lombok.NoArgsConstructor;
|
||||
@AllArgsConstructor
|
||||
public class CaptchaImageRespVO {
|
||||
|
||||
@ApiModelProperty(value = "uuid", required = true, example = "1b3b7d00-83a8-4638-9e37-d67011855968",
|
||||
notes = "通过该 uuid 作为该验证码的标识")
|
||||
@ApiModelProperty(value = "是否开启", required = true, example = "true", notes = "如果为 false,则关闭验证码功能")
|
||||
private Boolean enable;
|
||||
|
||||
@ApiModelProperty(value = "uuid", example = "1b3b7d00-83a8-4638-9e37-d67011855968",
|
||||
notes = "enable = true 时,非空!通过该 uuid 作为该验证码的标识")
|
||||
private String uuid;
|
||||
|
||||
@ApiModelProperty(value = "图片", required = true, notes = "验证码的图片内容,使用 Base64 编码")
|
||||
@ApiModelProperty(value = "图片", notes = "enable = true 时,非空!验证码的图片内容,使用 Base64 编码")
|
||||
private String img;
|
||||
|
||||
}
|
||||
|
@@ -38,6 +38,11 @@ public class DictDataBaseVO {
|
||||
// @InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
private String colorType;
|
||||
@ApiModelProperty(value = "css 样式", example = "btn-visible")
|
||||
private String cssClass;
|
||||
|
||||
@ApiModelProperty(value = "备注", example = "我是一个角色")
|
||||
private String remark;
|
||||
|
||||
|
@@ -17,4 +17,9 @@ public class DictDataSimpleRespVO {
|
||||
@ApiModelProperty(value = "字典标签", required = true, example = "男")
|
||||
private String label;
|
||||
|
||||
@ApiModelProperty(value = "颜色类型", example = "default", notes = "default、primary、success、info、warning、danger")
|
||||
private String colorType;
|
||||
@ApiModelProperty(value = "css 样式", example = "btn-visible")
|
||||
private String cssClass;
|
||||
|
||||
}
|
||||
|
@@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -18,6 +19,7 @@ public class UserBaseVO {
|
||||
|
||||
@ApiModelProperty(value = "用户账号", required = true, example = "yudao")
|
||||
@NotBlank(message = "用户账号不能为空")
|
||||
@Pattern(regexp = "^[a-zA-Z0-9]{4,30}$", message = "用户账号由 数字、字母 组成")
|
||||
@Size(min = 4, max = 30, message = "用户账号长度为 4-30 个字符")
|
||||
private String username;
|
||||
|
||||
|
@@ -46,6 +46,16 @@ public class DictDataDO extends BaseDO {
|
||||
* 枚举 {@link CommonStatusEnum}
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 颜色类型
|
||||
*
|
||||
* 对应到 element-ui 为 default、primary、success、info、warning、danger
|
||||
*/
|
||||
private String colorType;
|
||||
/**
|
||||
* css 样式
|
||||
*/
|
||||
private String cssClass;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
|
@@ -4,8 +4,10 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.servlet.ServletUtils;
|
||||
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.authentication.MultiUsernamePasswordAuthenticationToken;
|
||||
import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthLoginReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialBindReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.auth.vo.auth.AuthSocialLogin2ReqVO;
|
||||
@@ -16,7 +18,6 @@ import cn.iocoder.yudao.module.system.enums.logger.LoginLogTypeEnum;
|
||||
import cn.iocoder.yudao.module.system.enums.logger.LoginResultEnum;
|
||||
import cn.iocoder.yudao.module.system.service.common.CaptchaService;
|
||||
import cn.iocoder.yudao.module.system.service.logger.LoginLogService;
|
||||
import cn.iocoder.yudao.module.system.api.logger.dto.LoginLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.module.system.service.permission.PermissionService;
|
||||
import cn.iocoder.yudao.module.system.service.social.SocialUserService;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
@@ -35,6 +36,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -69,6 +71,9 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
@Resource
|
||||
private SocialUserService socialUserService;
|
||||
|
||||
@Resource
|
||||
private Validator validator;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
|
||||
// 获取 username 对应的 AdminUserDO
|
||||
@@ -96,7 +101,7 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
@Override
|
||||
public String login(AuthLoginReqVO reqVO, String userIp, String userAgent) {
|
||||
// 判断验证码是否正确
|
||||
this.verifyCaptcha(reqVO.getUsername(), reqVO.getUuid(), reqVO.getCode());
|
||||
this.verifyCaptcha(reqVO);
|
||||
|
||||
// 使用账号密码,进行登录
|
||||
LoginUser loginUser = this.login0(reqVO.getUsername(), reqVO.getPassword());
|
||||
@@ -105,27 +110,29 @@ public class AdminAuthServiceImpl implements AdminAuthService {
|
||||
return userSessionService.createUserSession(loginUser, userIp, userAgent);
|
||||
}
|
||||
|
||||
private void verifyCaptcha(String username, String captchaUUID, String captchaCode) {
|
||||
private void verifyCaptcha(AuthLoginReqVO reqVO) {
|
||||
// 如果验证码关闭,则不进行校验
|
||||
if (!captchaService.isCaptchaEnable()) {
|
||||
return;
|
||||
}
|
||||
// 校验验证码
|
||||
ValidationUtils.validate(validator, reqVO, AuthLoginReqVO.CodeEnableGroup.class);
|
||||
// 验证码不存在
|
||||
final LoginLogTypeEnum logTypeEnum = LoginLogTypeEnum.LOGIN_USERNAME;
|
||||
String code = captchaService.getCaptchaCode(captchaUUID);
|
||||
String code = captchaService.getCaptchaCode(reqVO.getUuid());
|
||||
if (code == null) {
|
||||
// 创建登录失败日志(验证码不存在)
|
||||
this.createLoginLog(username, logTypeEnum, LoginResultEnum.CAPTCHA_NOT_FOUND);
|
||||
this.createLoginLog(reqVO.getUsername(), logTypeEnum, LoginResultEnum.CAPTCHA_NOT_FOUND);
|
||||
throw exception(AUTH_LOGIN_CAPTCHA_NOT_FOUND);
|
||||
}
|
||||
// 验证码不正确
|
||||
if (!code.equals(captchaCode)) {
|
||||
if (!code.equals(reqVO.getCode())) {
|
||||
// 创建登录失败日志(验证码不正确)
|
||||
this.createLoginLog(username, logTypeEnum, LoginResultEnum.CAPTCHA_CODE_ERROR);
|
||||
this.createLoginLog(reqVO.getUsername(), logTypeEnum, LoginResultEnum.CAPTCHA_CODE_ERROR);
|
||||
throw exception(AUTH_LOGIN_CAPTCHA_CODE_ERROR);
|
||||
}
|
||||
// 正确,所以要删除下验证码
|
||||
captchaService.deleteCaptchaCode(captchaUUID);
|
||||
captchaService.deleteCaptchaCode(reqVO.getUuid());
|
||||
}
|
||||
|
||||
private LoginUser login0(String username, String password) {
|
||||
|
@@ -7,6 +7,7 @@ import cn.iocoder.yudao.module.system.convert.common.CaptchaConvert;
|
||||
import cn.iocoder.yudao.module.system.framework.captcha.config.CaptchaProperties;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.common.vo.CaptchaImageRespVO;
|
||||
import cn.iocoder.yudao.module.system.dal.redis.common.CaptchaRedisDAO;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -20,23 +21,35 @@ public class CaptchaServiceImpl implements CaptchaService {
|
||||
@Resource
|
||||
private CaptchaProperties captchaProperties;
|
||||
|
||||
/**
|
||||
* 验证码是否开关
|
||||
*
|
||||
* 虽然 {@link CaptchaProperties#getEnable()} 有该属性,但是 Apollo 在 Spring Boot 下无法刷新 @ConfigurationProperties 注解,
|
||||
* 所以暂时只能这么处理~
|
||||
*/
|
||||
@Value("${yudao.captcha.enable}")
|
||||
private Boolean enable;
|
||||
|
||||
@Resource
|
||||
private CaptchaRedisDAO captchaRedisDAO;
|
||||
|
||||
@Override
|
||||
public CaptchaImageRespVO getCaptchaImage() {
|
||||
if (!Boolean.TRUE.equals(enable)) {
|
||||
return CaptchaImageRespVO.builder().enable(enable).build();
|
||||
}
|
||||
// 生成验证码
|
||||
CircleCaptcha captcha = CaptchaUtil.createCircleCaptcha(captchaProperties.getWidth(), captchaProperties.getHeight());
|
||||
// 缓存到 Redis 中
|
||||
String uuid = IdUtil.fastSimpleUUID();
|
||||
captchaRedisDAO.set(uuid, captcha.getCode(), captchaProperties.getTimeout());
|
||||
// 返回
|
||||
return CaptchaConvert.INSTANCE.convert(uuid, captcha);
|
||||
return CaptchaConvert.INSTANCE.convert(uuid, captcha).setEnable(enable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean isCaptchaEnable() {
|
||||
return captchaProperties.getEnable();
|
||||
return enable;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -112,7 +112,7 @@ public class DeptServiceImpl implements DeptService {
|
||||
if (maxUpdateTime == null) { // 如果更新时间为空,说明 DB 一定有新数据
|
||||
log.info("[loadMenuIfUpdate][首次加载全量部门]");
|
||||
} else { // 判断数据库中是否有更新的部门
|
||||
if (deptMapper.selectExistsByUpdateTimeAfter(maxUpdateTime) != null) {
|
||||
if (deptMapper.selectExistsByUpdateTimeAfter(maxUpdateTime) == null) {
|
||||
return null;
|
||||
}
|
||||
log.info("[loadMenuIfUpdate][增量加载全量部门]");
|
||||
|
@@ -385,6 +385,8 @@ public class PermissionServiceImpl implements PermissionService {
|
||||
if (Objects.equals(role.getDataScope(), DataScopeEnum.DEPT_AND_CHILD.getScope())) {
|
||||
List<DeptDO> depts = deptService.getDeptsByParentIdFromCache(loginUser.getDeptId(), true);
|
||||
CollUtil.addAll(result.getDeptIds(), CollectionUtils.convertList(depts, DeptDO::getId));
|
||||
//添加本身部门id
|
||||
CollUtil.addAll(result.getDeptIds(), loginUser.getDeptId());
|
||||
continue;
|
||||
}
|
||||
// 情况五,SELF
|
||||
@@ -404,7 +406,7 @@ public class PermissionServiceImpl implements PermissionService {
|
||||
@Override
|
||||
public Set<Long> getUserRoleIdListByRoleIds(Collection<Long> roleIds) {
|
||||
return CollectionUtils.convertSet(userRoleMapper.selectListByRoleIds(roleIds),
|
||||
UserRoleDO::getRoleId);
|
||||
UserRoleDO::getUserId);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -27,6 +27,7 @@ import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Validator;
|
||||
import java.util.Set;
|
||||
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
@@ -62,6 +63,9 @@ public class AuthServiceImplTest extends BaseDbUnitTest {
|
||||
@MockBean
|
||||
private PostService postService;
|
||||
|
||||
@MockBean
|
||||
private Validator validator;
|
||||
|
||||
@BeforeEach
|
||||
public void setUp() {
|
||||
when(captchaService.isCaptchaEnable()).thenReturn(true);
|
||||
|
@@ -1,14 +1,8 @@
|
||||
package cn.iocoder.yudao.module.system.service.logger;
|
||||
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.monitor.TracerUtils;
|
||||
@@ -16,6 +10,13 @@ import cn.iocoder.yudao.framework.common.util.object.ObjectUtils;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.dto.OperateLogCreateReqDTO;
|
||||
import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
import cn.iocoder.yudao.framework.test.core.util.RandomUtils;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogExportReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.logger.vo.operatelog.OperateLogPageReqVO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.logger.OperateLogDO;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.logger.OperateLogMapper;
|
||||
import cn.iocoder.yudao.module.system.enums.common.SexEnum;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import cn.iocoder.yudao.module.system.test.BaseDbUnitTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.mock.mockito.MockBean;
|
||||
@@ -27,6 +28,8 @@ import java.util.List;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import static cn.hutool.core.util.RandomUtil.randomEle;
|
||||
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.BAD_REQUEST;
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals;
|
||||
import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId;
|
||||
@@ -51,6 +54,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest {
|
||||
OperateLogCreateReqDTO reqVO = RandomUtils.randomPojo(OperateLogCreateReqDTO.class, o -> {
|
||||
o.setTraceId(traceId);
|
||||
o.setUserId(randomLongId());
|
||||
o.setUserType(randomEle(UserTypeEnum.values()).getValue());
|
||||
o.setExts(MapUtil.<String, Object>builder("orderId", randomLongId()).build());
|
||||
});
|
||||
|
||||
@@ -76,6 +80,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest {
|
||||
// 构造操作日志
|
||||
OperateLogDO sysOperateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> {
|
||||
o.setUserId(userId);
|
||||
o.setUserType(randomEle(UserTypeEnum.values()).getValue());
|
||||
o.setModule("order");
|
||||
o.setType(OperateTypeEnum.CREATE.getType());
|
||||
o.setStartTime(buildTime(2021, 3, 6));
|
||||
@@ -94,7 +99,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest {
|
||||
// createTime 不同
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setStartTime(buildTime(2021, 2, 6))));
|
||||
// resultCode 不同
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(GlobalErrorCodeConstants.BAD_REQUEST.getCode())));
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(BAD_REQUEST.getCode())));
|
||||
|
||||
// 构造调用参数
|
||||
OperateLogPageReqVO reqVO = new OperateLogPageReqVO();
|
||||
@@ -127,6 +132,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest {
|
||||
// 构造操作日志
|
||||
OperateLogDO sysOperateLogDO = RandomUtils.randomPojo(OperateLogDO.class, o -> {
|
||||
o.setUserId(userId);
|
||||
o.setUserType(randomEle(UserTypeEnum.values()).getValue());
|
||||
o.setModule("order");
|
||||
o.setType(OperateTypeEnum.CREATE.getType());
|
||||
o.setStartTime(buildTime(2021, 3, 6));
|
||||
@@ -145,7 +151,7 @@ public class OperateLogServiceImplTest extends BaseDbUnitTest {
|
||||
// createTime 不同
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setStartTime(buildTime(2021, 2, 6))));
|
||||
// resultCode 不同
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(GlobalErrorCodeConstants.BAD_REQUEST.getCode())));
|
||||
operateLogMapper.insert(ObjectUtils.cloneIgnoreId(sysOperateLogDO, logDO -> logDO.setResultCode(BAD_REQUEST.getCode())));
|
||||
|
||||
// 构造调用参数
|
||||
OperateLogExportReqVO reqVO = new OperateLogExportReqVO();
|
||||
|
@@ -203,8 +203,9 @@ public class PermissionServiceTest extends BaseDbUnitTest {
|
||||
// 断言
|
||||
assertFalse(result.getAll());
|
||||
assertFalse(result.getSelf());
|
||||
assertEquals(1, result.getDeptIds().size());
|
||||
assertEquals(2, result.getDeptIds().size());
|
||||
assertTrue(CollUtil.contains(result.getDeptIds(), deptDO.getId()));
|
||||
assertTrue(CollUtil.contains(result.getDeptIds(), loginUser.getDeptId()));
|
||||
assertSame(result, loginUser.getContext(PermissionServiceImpl.CONTEXT_KEY, DeptDataPermissionRespDTO.class));
|
||||
}
|
||||
|
||||
|
@@ -48,3 +48,4 @@ yudao:
|
||||
timeout: 5m
|
||||
width: 160
|
||||
height: 60
|
||||
enable: true
|
||||
|
@@ -1,5 +1,3 @@
|
||||
-- sys 开头的 DB
|
||||
|
||||
CREATE TABLE IF NOT EXISTS "system_dept" (
|
||||
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
"name" varchar(30) NOT NULL DEFAULT '',
|
||||
@@ -25,6 +23,8 @@ CREATE TABLE IF NOT EXISTS "system_dict_data" (
|
||||
"value" varchar(100) NOT NULL DEFAULT '',
|
||||
"dict_type" varchar(100) NOT NULL DEFAULT '',
|
||||
"status" tinyint NOT NULL DEFAULT '0',
|
||||
"color_type" varchar(100) NOT NULL DEFAULT '',
|
||||
"css_class" varchar(100) NOT NULL DEFAULT '',
|
||||
"remark" varchar(500) DEFAULT NULL,
|
||||
"creator" varchar(64) DEFAULT '',
|
||||
"create_time" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
@@ -179,6 +179,7 @@ CREATE TABLE IF NOT EXISTS `system_operate_log` (
|
||||
`id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY,
|
||||
`trace_id` varchar(64) NOT NULL DEFAULT '',
|
||||
`user_id` bigint(20) NOT NULL,
|
||||
"user_type" tinyint not null default '0',
|
||||
`module` varchar(50) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`operate_type` bigint(4) NOT NULL DEFAULT '0',
|
||||
|
@@ -15,7 +15,7 @@
|
||||
<artifactId>yudao-module-tool</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
tool 模块,我们放研发工具,提升研发效率与质量。
|
||||
例如说:代码生成器、接口文档等等
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-tool-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
tool 模块 API,暴露给其它模块调用
|
||||
</description>
|
||||
|
@@ -11,7 +11,7 @@
|
||||
<artifactId>yudao-module-tool-impl</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
tool 模块,我们放研发工具,提升研发效率与质量。
|
||||
例如说:代码生成器、接口文档等等
|
||||
|
@@ -51,7 +51,7 @@
|
||||
v-hasPermi="['${permissionPrefix}:create']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
|
||||
v-hasPermi="['${permissionPrefix}:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
@@ -74,7 +74,7 @@
|
||||
#elseif("" != $column.dictType)## 数据字典
|
||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ getDictDataLabel(DICT_TYPE.$dictType.toUpperCase(), scope.row.${column.javaField}) }}</span>
|
||||
<dict-type :type="DICT_TYPE.$dictType.toUpperCase()" :value="scope.row.${column.javaField}" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
#else
|
||||
@@ -207,6 +207,8 @@ export default {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
@@ -345,7 +347,7 @@ export default {
|
||||
// 修改的提交
|
||||
if (this.form.${primaryColumn.javaField} != null) {
|
||||
update${simpleClassName}(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -353,7 +355,7 @@ export default {
|
||||
}
|
||||
// 添加的提交
|
||||
create${simpleClassName}(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -362,16 +364,12 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ${primaryColumn.javaField} = row.${primaryColumn.javaField};
|
||||
this.$confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.#[[$modal]]#.confirm('是否确认删除${table.classComment}编号为"' + ${primaryColumn.javaField} + '"的数据项?').then(function() {
|
||||
return delete${simpleClassName}(${primaryColumn.javaField});
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -388,15 +386,13 @@ export default {
|
||||
#end
|
||||
#end
|
||||
// 执行导出
|
||||
this.$confirm('是否确认导出所有${table.classComment}数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.#[[$modal]]#.confirm('是否确认导出所有${table.classComment}数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return export${simpleClassName}Excel(params);
|
||||
}).then(response => {
|
||||
this.downloadExcel(response, '${table.classComment}.xls');
|
||||
})
|
||||
this.$download.excel(response, '${table.classComment}.xls');
|
||||
this.exportLoading = false;
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@@ -12,7 +12,7 @@
|
||||
<artifactId>yudao-server</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${artifactId}</name>
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
后端 Server 的主项目,通过引入需要 yudao-module-xxx 的依赖,
|
||||
从而实现提供 RESTful API 给 yudao-ui-admin、yudao-ui-user 等前端项目。
|
||||
@@ -71,12 +71,13 @@
|
||||
|
||||
<build>
|
||||
<!-- 设置构建的 jar 包名 -->
|
||||
<finalName>${artifactId}</finalName>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<!-- 打包 -->
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>2.5.9</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 -->
|
||||
<configuration>
|
||||
<fork>true</fork>
|
||||
</configuration>
|
||||
|
45
yudao-server/src/main/resources/admin-ui/html/ie.html
Normal file
45
yudao-server/src/main/resources/admin-ui/html/ie.html
Normal file
File diff suppressed because one or more lines are too long
BIN
yudao-server/src/main/resources/admin-ui/html/ie.html.gz
Normal file
BIN
yudao-server/src/main/resources/admin-ui/html/ie.html.gz
Normal file
Binary file not shown.
@@ -7,7 +7,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||
<link rel="icon" href="/admin-ui/favicon.ico">
|
||||
<title>芋道管理系统</title>
|
||||
<style>
|
||||
<!--[if lt IE 11]><script>window.location.href='html/ie.html';</script><![endif]-->
|
||||
<style>
|
||||
html,
|
||||
body,
|
||||
#app {
|
||||
|
BIN
yudao-server/src/main/resources/admin-ui/index.html.gz
Normal file
BIN
yudao-server/src/main/resources/admin-ui/index.html.gz
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user