ids;
28 |
29 | @ApiModelProperty(value = "通用状态,0为正常,1为禁用", required=true)
30 | private Integer state;
31 | }
32 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/plugin/dto/PluginSchemaDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.plugin.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 插件元数据数据传输类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2022-09-05 10:05
16 | */
17 | @Data
18 | @ApiModel(value="插件元数据", description="插件元数据")
19 | public class PluginSchemaDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "元数据")
28 | private String schemaData;
29 |
30 | @ApiModelProperty(value = "分组")
31 | private String groupId;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/ContentDetailWrap/src/ContentDetailWrap.vue:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/TagsView/src/helper.ts:
--------------------------------------------------------------------------------
1 | import type { RouteLocationNormalizedLoaded } from 'vue-router'
2 | import { pathResolve } from '@/utils/routerHelper'
3 |
4 | export const filterAffixTags = (routes: AppRouteRecordRaw[], parentPath = '') => {
5 | let tags: RouteLocationNormalizedLoaded[] = []
6 | routes.forEach((route) => {
7 | const meta = route.meta ?? {}
8 | const tagPath = pathResolve(parentPath, route.path)
9 | if (meta?.affix) {
10 | tags.push({ ...route, path: tagPath, fullPath: tagPath } as RouteLocationNormalizedLoaded)
11 | }
12 | if (route.children) {
13 | const tempTags: RouteLocationNormalizedLoaded[] = filterAffixTags(route.children, tagPath)
14 | if (tempTags.length >= 1) {
15 | tags = [...tags, ...tempTags]
16 | }
17 | }
18 | })
19 |
20 | return tags
21 | }
22 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/plugins/upload/local/config/LocalConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.plugins.upload.local.config;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 本地文件上传配置数据传输类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2021-02-05 11:16
16 | */
17 | @Data
18 | @ApiModel(value="本地文件上传配置", description="本地文件上传配置")
19 | public class LocalConfig implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "本地目录地址")
28 | private String localDir;
29 |
30 | @ApiModelProperty(value = "访问路径")
31 | private String visitUrl;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/SysUserRoleDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 用户角色请求类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-04-13 16:57
16 | */
17 | @Data
18 | @ApiModel(value="用户角色", description="用户角色")
19 | public class SysUserRoleDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "用户ID", required=true)
28 | private String userId;
29 |
30 | @ApiModelProperty(value = "角色ID", required=true)
31 | private String roleId;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/plugins/echarts/index.ts:
--------------------------------------------------------------------------------
1 | import * as echarts from 'echarts/core'
2 |
3 | import {
4 | BarChart,
5 | LineChart,
6 | PieChart,
7 | MapChart,
8 | PictorialBarChart,
9 | RadarChart
10 | } from 'echarts/charts'
11 |
12 | import {
13 | TitleComponent,
14 | TooltipComponent,
15 | GridComponent,
16 | PolarComponent,
17 | AriaComponent,
18 | ParallelComponent,
19 | LegendComponent
20 | } from 'echarts/components'
21 |
22 | import { CanvasRenderer } from 'echarts/renderers'
23 |
24 | echarts.use([
25 | LegendComponent,
26 | TitleComponent,
27 | TooltipComponent,
28 | GridComponent,
29 | PolarComponent,
30 | AriaComponent,
31 | ParallelComponent,
32 | BarChart,
33 | LineChart,
34 | PieChart,
35 | MapChart,
36 | CanvasRenderer,
37 | PictorialBarChart,
38 | RadarChart
39 | ])
40 |
41 | export default echarts
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/request/DepartSortReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.depart.dto.request;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 部门排序请求类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-03-14 10:37
16 | */
17 | @Data
18 | @ApiModel(value="拖动排序请求类", description="拖动排序请求类")
19 | public class DepartSortReqDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | @ApiModelProperty(value = "源菜单ID")
24 | private String form;
25 |
26 | @ApiModelProperty(value = "目标菜单ID")
27 | private String to;
28 |
29 | @ApiModelProperty(value = "目标类型,inner放入,before放在前面,after放到后面")
30 | private String dropType;
31 | }
32 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/role/dto/SysRoleMenuDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.role.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 角色菜单授权数据传输类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2021-03-02 15:44
16 | */
17 | @Data
18 | @ApiModel(value="角色菜单授权", description="角色菜单授权")
19 | public class SysRoleMenuDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "角色ID", required=true)
28 | private String roleId;
29 |
30 | @ApiModelProperty(value = "菜单ID", required=true)
31 | private String menuId;
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/Breadcrumb/src/helper.ts:
--------------------------------------------------------------------------------
1 | import { pathResolve } from '@/utils/routerHelper'
2 |
3 | export const filterBreadcrumb = (
4 | routes: AppRouteRecordRaw[],
5 | parentPath = ''
6 | ): AppRouteRecordRaw[] => {
7 | const res: AppRouteRecordRaw[] = []
8 |
9 | for (const route of routes) {
10 | const meta = route?.meta
11 | if (meta.hidden && !meta.canTo) {
12 | continue
13 | }
14 |
15 | const data: AppRouteRecordRaw =
16 | !meta.alwaysShow && route.children?.length === 1
17 | ? { ...route.children[0], path: pathResolve(route.path, route.children[0].path) }
18 | : { ...route }
19 |
20 | data.path = pathResolve(parentPath, data.path)
21 |
22 | if (data.children) {
23 | data.children = filterBreadcrumb(data.children, data.path)
24 | }
25 | if (data) {
26 | res.push(data)
27 | }
28 | }
29 | return res
30 | }
31 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/api/api/dto/BaseQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.api.api.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.AllArgsConstructor;
6 | import lombok.Data;
7 | import lombok.NoArgsConstructor;
8 |
9 | import java.util.Date;
10 |
11 | /**
12 | *
13 | * 按关键字查询请求通用类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2019-04-20 12:15
18 | */
19 | @Data
20 | @ApiModel(value="按关键字查询请求通用类", description="按关键字查询请求通用类")
21 | @AllArgsConstructor
22 | @NoArgsConstructor
23 | public class BaseQueryReqDTO extends BaseDTO {
24 |
25 |
26 | @ApiModelProperty(value = "日期开始", required=true)
27 | private Date statDateL;
28 |
29 | @ApiModelProperty(value = "日期结束", required=true)
30 | private Date statDateR;
31 |
32 | @ApiModelProperty(value = "关键字查询", required=true)
33 | private String q;
34 | }
35 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/MultipartConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.config;
2 |
3 | import org.springframework.boot.web.servlet.MultipartConfigFactory;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.util.unit.DataSize;
7 |
8 | import javax.servlet.MultipartConfigElement;
9 |
10 | /**
11 | * 文件上传配置
12 | * @author bool
13 | * @date 2019-07-29 16:23
14 | */
15 | @Configuration
16 | public class MultipartConfig {
17 |
18 | @Bean
19 | public MultipartConfigElement multipartConfigElement() {
20 | MultipartConfigFactory factory = new MultipartConfigFactory();
21 | // 单个数据大小
22 | factory.setMaxFileSize(DataSize.ofMegabytes(5000L));
23 | /// 总上传数据大小
24 | factory.setMaxRequestSize(DataSize.ofMegabytes(5000L));
25 | return factory.createMultipartConfig();
26 | }
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/config/service/CfgSwitchService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.config.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.yf.system.modules.config.entity.CfgSwitch;
5 |
6 | import java.util.Map;
7 |
8 | /**
9 | *
10 | * 功能配置业务接口类
11 | *
12 | *
13 | * @author 聪明笨狗
14 | * @since 2021-11-06 12:02
15 | */
16 | public interface CfgSwitchService extends IService {
17 |
18 | /**
19 | * 查找全部组成一个Map
20 | * @return
21 | */
22 | Map allMap();
23 |
24 | /**
25 | * 查询是否开启
26 | * @param id
27 | * @return
28 | */
29 | Boolean isOn(String id);
30 |
31 | /**
32 | * 取值
33 | * @param id
34 | * @return
35 | */
36 | String val(String id);
37 |
38 | /**
39 | * 保存功能开关
40 | * @param map
41 | */
42 | void save(Map map);
43 | }
44 |
--------------------------------------------------------------------------------
/yf-boot-vue/plop/view/prompt.js:
--------------------------------------------------------------------------------
1 | const toUpperCase = (str) => str.charAt(0).toUpperCase() + str.slice(1)
2 |
3 | module.exports = {
4 | description: 'Create vue view',
5 | prompts: [
6 | {
7 | type: 'input',
8 | name: 'path',
9 | message: '请输入路径(Please enter a path)',
10 | default: 'views'
11 | },
12 | {
13 | type: 'input',
14 | name: 'name',
15 | message: '请输入模块名称(Please enter module name)'
16 | }
17 | ],
18 | actions: (data) => {
19 | const { name, path } = data
20 | const upperFirstName = toUpperCase(name)
21 |
22 | const actions = []
23 | if (name) {
24 | actions.push({
25 | type: 'add',
26 | path: `./src/${path}/${upperFirstName}.vue`,
27 | templateFile: './plop/view/view.hbs',
28 | data: {
29 | name,
30 | upperFirstName
31 | }
32 | })
33 | }
34 |
35 | return actions
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/hooks/web/useNProgress.ts:
--------------------------------------------------------------------------------
1 | import { nextTick, unref } from 'vue'
2 | import type { NProgressOptions } from 'nprogress'
3 | import NProgress from 'nprogress'
4 | import 'nprogress/nprogress.css'
5 | import { useCssVar } from '@vueuse/core'
6 |
7 | const primaryColor = useCssVar('--el-color-primary', document.documentElement)
8 |
9 | export const useNProgress = () => {
10 | NProgress.configure({ showSpinner: false } as NProgressOptions)
11 |
12 | const initColor = async () => {
13 | await nextTick()
14 | const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef
15 | if (bar) {
16 | bar.style.background = unref(primaryColor.value)
17 | }
18 | }
19 |
20 | initColor()
21 |
22 | const start = () => {
23 | NProgress.start()
24 | }
25 |
26 | const done = () => {
27 | NProgress.done()
28 | }
29 |
30 | return {
31 | start,
32 | done
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/config/entity/CfgSwitch.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.config.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 功能配置实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2021-11-06 12:02
17 | */
18 | @Data
19 | @TableName("el_cfg_switch")
20 | public class CfgSwitch extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * 功能名称
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 开关或值
32 | */
33 | @TableField("val")
34 | private String val;
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/plugin/entity/PluginGroup.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.plugin.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import com.baomidou.mybatisplus.extension.activerecord.Model;
7 | import lombok.Data;
8 |
9 | /**
10 | *
11 | * 插件分组实体类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2022-09-05 10:05
16 | */
17 | @Data
18 | @TableName("pl_plugin_group")
19 | public class PluginGroup extends Model {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | /**
24 | * ID
25 | */
26 | @TableId(value = "id", type = IdType.ASSIGN_ID)
27 | private String id;
28 |
29 | /**
30 | * 分组名称
31 | */
32 | private String title;
33 |
34 | /**
35 | * 独立排斥
36 | */
37 | private Boolean single;
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/api/annon/DataProtect.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.api.annon;
2 |
3 |
4 | import java.lang.annotation.Documented;
5 | import java.lang.annotation.ElementType;
6 | import java.lang.annotation.Retention;
7 | import java.lang.annotation.RetentionPolicy;
8 | import java.lang.annotation.Target;
9 |
10 | /**
11 | * 保护某些数据不被删除或更新
12 | * @author bool
13 | */
14 | @Documented
15 | @Retention(RetentionPolicy.RUNTIME)
16 | @Target({ElementType.TYPE, ElementType.METHOD})
17 | public @interface DataProtect {
18 |
19 | /**
20 | * 更新保护
21 | * @return
22 | */
23 | boolean update() default false;
24 |
25 | /**
26 | * 删除保护
27 | * @return
28 | */
29 | boolean delete() default false;
30 |
31 | /**
32 | * 当前用户ID
33 | * @return
34 | */
35 | boolean currUsr() default false;
36 |
37 | /**
38 | * 实体类名,获取表名
39 | * @return
40 | */
41 | Class clazz();
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/resources/application.yml:
--------------------------------------------------------------------------------
1 | spring:
2 | application:
3 | name: yf-boot-api
4 | profiles:
5 | active: dev
6 | main:
7 | allow-bean-definition-overriding: true
8 | jackson:
9 | date-format: yyyy-MM-dd HH:mm:ss
10 | time-zone: GMT+8
11 | default-property-inclusion: non_null
12 | deserialization:
13 | fail_on_unknown_properties: false
14 | accept-empty-string-as-null-object: true
15 | parser:
16 | # 允许出现特殊字符和转义符
17 | allow_unquoted_control_chars: true
18 | #允许出现单引号
19 | allow_single_quotes: true
20 | serialization:
21 | fail-on-empty-beans: false
22 | mapper:
23 | # 支持类型转换
24 | allow-coercion-of-scalars: true
25 | server:
26 | port: 8080
27 | # 启用服务端压缩
28 | compression:
29 | enabled: true
30 | min-response-size: 10
31 | mime-types: application/json,application/xml,text/html,text/xml,text/plain,application/javascript,text/css
32 |
33 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/resources/mapper/sys/config/CfgBaseMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | `id`,`site_name`,`login_logo`,`login_bg`,`back_logo`,`copy_right`
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/api/sys/dict/index.ts:
--------------------------------------------------------------------------------
1 | import request from '@/config/axios'
2 |
3 | export const pagingApi = (data: any) => {
4 | return request.post({
5 | url: '/api/sys/dic/paging',
6 | data
7 | })
8 | }
9 |
10 | export const saveApi = (data: any) => {
11 | return request.post({
12 | url: '/api/sys/dic/save',
13 | data
14 | })
15 | }
16 |
17 | export const detailApi = (data: any) => {
18 | return request.post({
19 | url: '/api/sys/dic/detail',
20 | data
21 | })
22 | }
23 |
24 | export const subListApi = (data: any) => {
25 | return request.post({
26 | url: '/api/sys/dic/value/tree',
27 | data
28 | })
29 | }
30 |
31 | export const subSaveApi = (data: any) => {
32 | return request.post({
33 | url: '/api/sys/dic/value/save',
34 | data
35 | })
36 | }
37 |
38 | export const subDeleteApi = (data: any) => {
39 | return request.post({
40 | url: '/api/sys/dic/value/delete',
41 | data
42 | })
43 | }
44 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/ability/upload/service/UploadService.java:
--------------------------------------------------------------------------------
1 | package com.yf.ability.upload.service;
2 |
3 | import com.yf.plugins.upload.local.dto.UploadRespDTO;
4 | import org.springframework.web.multipart.MultipartFile;
5 |
6 | import javax.servlet.http.HttpServletRequest;
7 | import javax.servlet.http.HttpServletResponse;
8 | import java.io.IOException;
9 |
10 | /**
11 | * 服务器端上传文件方法
12 | * @author van
13 | */
14 | public interface UploadService {
15 |
16 | /**
17 | * 上传文件
18 | * @param multipartFile
19 | * @return
20 | */
21 | UploadRespDTO upload(MultipartFile multipartFile);
22 |
23 | /**
24 | * 本地上传
25 | * @param localFile
26 | * @return
27 | */
28 | String upload(String localFile);
29 |
30 | /**
31 | * 下载文件
32 | * @param request
33 | * @param response
34 | */
35 | void download(HttpServletRequest request, HttpServletResponse response) throws IOException;
36 | }
37 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/resources/mapper/sys/user/SysUserBindMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | `id`,`user_id`,`login_type`,`open_id`,`create_time`,`update_time`
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/CacheKey.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils;
2 |
3 | import java.text.MessageFormat;
4 |
5 | /**
6 | * 缓存Key定义
7 | * @author bool
8 | */
9 | public interface CacheKey {
10 |
11 | /**
12 | * 网站
13 | */
14 | String SITE = "sys:site";
15 |
16 | /**
17 | * 菜单路由
18 | */
19 | String MENU = "sys:menu";
20 |
21 | /**
22 | * 数据字典
23 | */
24 | String DICT = "sys:dict";
25 |
26 | /**
27 | * 用户token
28 | */
29 | String TOKEN = "user:token";
30 |
31 |
32 | /**
33 | * 上传配置
34 | */
35 | String UPLOAD = "sys:upload";
36 |
37 | String SWITCH = "sys:switch";
38 |
39 | /**
40 | * 课件解锁,用于在解锁下一个课件时写入缓存
41 | * @param userId
42 | * @param courseId
43 | * @return
44 | */
45 | static String unlockKey(String userId, String courseId){
46 | return MessageFormat.format("sys:file:unlock:{0}-{1}", userId, courseId);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/websocket/WebSocketConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.config.websocket;
2 |
3 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.web.socket.config.annotation.EnableWebSocket;
7 | import org.springframework.web.socket.server.standard.ServerEndpointExporter;
8 |
9 | /**
10 | * Webscoket配置文件
11 | * @author bool
12 | * @date 2019-09-26 09:39
13 | */
14 | @ConditionalOnWebApplication
15 | @Configuration
16 | @EnableWebSocket
17 | public class WebSocketConfig {
18 |
19 | @Bean
20 | public CustomSpringConfigurator customSpringConfigurator() {
21 | // 获取容器
22 | return new CustomSpringConfigurator();
23 | }
24 |
25 | @Bean
26 | public ServerEndpointExporter serverEndpointExporter() {
27 | return new ServerEndpointExporter();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/Collapse/src/Collapse.vue:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/service/SysDicService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.service;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.service.IService;
5 | import com.yf.base.api.api.dto.PagingReqDTO;
6 | import com.yf.system.modules.dict.dto.SysDicDTO;
7 | import com.yf.system.modules.dict.entity.SysDic;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * 分类字典业务类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2020-12-01 14:00
18 | */
19 | public interface SysDicService extends IService {
20 |
21 | /**
22 | * 分页查询数据
23 | * @param reqDTO
24 | * @return
25 | */
26 | IPage paging(PagingReqDTO reqDTO);
27 |
28 | /**
29 | * 保存字典
30 | * @param reqDTO
31 | */
32 | void save(SysDicDTO reqDTO);
33 |
34 | /**
35 | * 批量删除
36 | * @param ids
37 | */
38 | void delete(List ids);
39 |
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/MybatisConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.config;
2 |
3 | import com.yf.system.aspect.mybatis.QueryInterceptor;
4 | import com.yf.system.aspect.mybatis.UpdateInterceptor;
5 | import org.mybatis.spring.annotation.MapperScan;
6 | import org.springframework.context.annotation.Bean;
7 | import org.springframework.context.annotation.Configuration;
8 |
9 | /**
10 | * Mybatis过滤器配置
11 | * 注意:必须按顺序进行配置,否则容易出现业务异常
12 | *
13 | * @author bool
14 | */
15 | @Configuration
16 | @MapperScan("com.yf.**.mapper")
17 | public class MybatisConfig {
18 |
19 | /**
20 | * 数据查询过滤器
21 | */
22 | @Bean
23 | public QueryInterceptor queryInterceptor() {
24 | QueryInterceptor query = new QueryInterceptor();
25 | query.setLimit(-1L);
26 | return query;
27 | }
28 |
29 | /**
30 | * 插入数据过滤器
31 | */
32 | @Bean
33 | public UpdateInterceptor updateInterceptor() {
34 | return new UpdateInterceptor();
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserLoginReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto.request;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 管理员登录请求类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-04-13 16:57
16 | */
17 | @Data
18 | @ApiModel(value="管理员登录请求类", description="管理员登录请求类")
19 | public class SysUserLoginReqDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | @ApiModelProperty(value = "用户名", required=true)
24 | private String userName;
25 |
26 | @ApiModelProperty(value = "密码", required=true)
27 | private String password;
28 |
29 | @ApiModelProperty(value = "验证码key", required=true)
30 | private String captchaKey;
31 |
32 | @ApiModelProperty(value = "用户输入的验证码值", required=true)
33 | private String captchaValue;
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/SpringUtils.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils;
2 |
3 | import org.springframework.beans.BeansException;
4 | import org.springframework.context.ApplicationContext;
5 | import org.springframework.context.ApplicationContextAware;
6 | import org.springframework.stereotype.Component;
7 |
8 | /**
9 | * Spring获取工具
10 | *
11 | * @author bool
12 | * @date 2019-12-09 15:55
13 | */
14 | @Component
15 | public class SpringUtils implements ApplicationContextAware {
16 |
17 | private static ApplicationContext applicationContext;
18 |
19 | @Override
20 | public void setApplicationContext(ApplicationContext context) throws BeansException {
21 | applicationContext = context;
22 | }
23 |
24 | public static T getBean(Class tClass) {
25 | return applicationContext.getBean(tClass);
26 | }
27 |
28 | public static T getBean(String name, Class type) {
29 | return applicationContext.getBean(name, type);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/request/DepartQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.depart.dto.request;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.Data;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | *
12 | * 部门排序请求类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-03-14 10:37
17 | */
18 | @Data
19 | @ApiModel(value="部门查询请求类", description="部门排序请求类")
20 | public class DepartQueryReqDTO implements Serializable {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | @ApiModelProperty(value = "分类ID")
25 | private String parentId;
26 |
27 | @JsonIgnore
28 | private String deptCodes;
29 |
30 | @JsonIgnore
31 | private String likeCode;
32 |
33 | @ApiModelProperty(value = "部门编号")
34 | private String deptCode;
35 |
36 | @ApiModelProperty(value = "部门名称")
37 | private String deptName;
38 | }
39 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/ImageViewer/src/ImageViewer.vue:
--------------------------------------------------------------------------------
1 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/BaseConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.config;
2 |
3 | import lombok.Data;
4 | import org.springframework.boot.context.properties.ConfigurationProperties;
5 | import org.springframework.context.annotation.Configuration;
6 |
7 |
8 | /**
9 | * 全局静态配置
10 | * @author bool
11 | */
12 | @Data
13 | @Configuration
14 | @ConfigurationProperties(prefix = "ycloud")
15 | public class BaseConfig {
16 |
17 |
18 | /**
19 | * 演示模式
20 | */
21 | private Boolean demo;
22 |
23 | /**
24 | * 踢出登录
25 | */
26 | private Boolean loginTick;
27 |
28 | /**
29 | * 微信登录回调地址
30 | */
31 | private String loginRedirect;
32 |
33 | /**
34 | * PC端登录同步地址
35 | */
36 | private String loginSyncPc;
37 |
38 | /**
39 | * 手机端登录同步地址
40 | */
41 | private String loginSyncH5;
42 |
43 |
44 | /**
45 | * 是否演示模式
46 | * @return
47 | */
48 | public boolean isDemo(){
49 | return this.demo!=null && this.demo;
50 | }
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/DeptCodeGen.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils;
2 |
3 |
4 | import com.yf.base.api.exception.ServiceException;
5 |
6 | /**
7 | * 部门编码生成器,用于生成每个级别的部门,每个同级部门最多支持2573个,超出会异常
8 | * @author Van
9 | */
10 | public class DeptCodeGen {
11 |
12 | /**
13 | * 产生部门编号
14 | * @param num
15 | * @return
16 | */
17 | public static String gen(int num){
18 |
19 | if(num > 2573){
20 | throw new ServiceException("每级最大支持2573个部门!");
21 | }
22 |
23 | // 序列,0-99为A,100-199为B
24 | int index = num / 99;
25 | int left = num % 99;
26 | String tag = AbcTags.get(index);
27 | StringBuffer sb = new StringBuffer(tag);
28 | if(left < 10){
29 | sb.append("0");
30 | }
31 |
32 | sb.append(left);
33 | return sb.toString();
34 | }
35 |
36 | public static void main(String[] args) {
37 | for(int i=0;i<=2573;i++){
38 | System.out.println(gen(i));
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/plugin/entity/PluginSchema.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.plugin.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 插件元数据实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2022-09-05 10:05
17 | */
18 | @Data
19 | @TableName("pl_plugin_schema")
20 | public class PluginSchema extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * ID
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 元数据
32 | */
33 | private String schemaData;
34 |
35 | /**
36 | * 分组
37 | */
38 | @TableField("group_id")
39 | private String groupId;
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/SysDicDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.dto;
2 |
3 | import com.yf.base.api.annon.Dict;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.Data;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | *
12 | * 分类字典数据传输类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-12-01 14:00
17 | */
18 | @Data
19 | @ApiModel(value="分类字典", description="分类字典")
20 | public class SysDicDTO implements Serializable {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 |
25 | @ApiModelProperty(value = "ID", required=true)
26 | private String id;
27 |
28 | @ApiModelProperty(value = "字典编码")
29 | private String code;
30 |
31 | @Dict(dicCode = "dic_type")
32 | @ApiModelProperty(value = "1分类字典,2数据字典")
33 | private Integer type;
34 |
35 | @ApiModelProperty(value = "字典名称")
36 | private String title;
37 |
38 | @ApiModelProperty(value = "字典描述")
39 | private String remark;
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-vue/plop/component/prompt.js:
--------------------------------------------------------------------------------
1 | const toUpperCase = (str) => str.charAt(0).toUpperCase() + str.slice(1)
2 |
3 | module.exports = {
4 | description: 'Create vue component',
5 | prompts: [
6 | {
7 | type: 'input',
8 | name: 'name',
9 | message: '请输入组件名称(Please enter the component name)'
10 | }
11 | ],
12 | actions: (data) => {
13 | const { name } = data
14 | const upperFirstName = toUpperCase(name)
15 |
16 | const actions = []
17 | if (name) {
18 | actions.push({
19 | type: 'add',
20 | path: `./src/components/${upperFirstName}/src/${upperFirstName}.vue`,
21 | templateFile: './plop/component/component.hbs',
22 | data: {
23 | name,
24 | upperFirstName
25 | }
26 | }, {
27 | type: 'add',
28 | path: `./src/components/${upperFirstName}/index.ts`,
29 | templateFile: './plop/component/index.hbs',
30 | data: {
31 | upperFirstName
32 | }
33 | })
34 | }
35 |
36 | return actions
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/config/axios/types/index.ts:
--------------------------------------------------------------------------------
1 | import type {
2 | InternalAxiosRequestConfig,
3 | AxiosResponse,
4 | AxiosRequestConfig,
5 | AxiosInstance,
6 | AxiosRequestHeaders,
7 | AxiosError
8 | } from 'axios'
9 |
10 | interface RequestInterceptors {
11 | // 请求拦截
12 | requestInterceptors?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig
13 | requestInterceptorsCatch?: (err: any) => any
14 | // 响应拦截
15 | responseInterceptors?: (config: T) => T
16 | responseInterceptorsCatch?: (err: any) => any
17 | }
18 | interface AxiosConfig {
19 | code: number
20 | defaultHeaders: AxiosHeaders
21 | timeout: number
22 | interceptors: RequestInterceptors
23 | }
24 |
25 | interface RequestConfig extends AxiosRequestConfig {
26 | interceptors?: RequestInterceptors
27 | }
28 |
29 | export {
30 | AxiosResponse,
31 | RequestInterceptors,
32 | RequestConfig,
33 | AxiosConfig,
34 | AxiosInstance,
35 | InternalAxiosRequestConfig,
36 | AxiosRequestHeaders,
37 | AxiosError
38 | }
39 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/assets/svgs/icon.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/role/entity/SysRoleMenu.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.role.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 角色菜单授权实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2021-03-02 15:44
17 | */
18 | @Data
19 | @TableName("el_sys_role_menu")
20 | public class SysRoleMenu extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * ID
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 角色ID
32 | */
33 | @TableField("role_id")
34 | private String roleId;
35 |
36 | /**
37 | * 菜单ID
38 | */
39 | @TableField("menu_id")
40 | private String menuId;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/entity/SysUserRole.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 用户角色实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-04-13 16:57
17 | */
18 | @Data
19 | @TableName("el_sys_user_role")
20 | public class SysUserRole extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * ID
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 用户ID
32 | */
33 | @TableField("user_id")
34 | private String userId;
35 |
36 | /**
37 | * 角色ID
38 | */
39 | @TableField("role_id")
40 | private String roleId;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/hooks/web/useLocale.ts:
--------------------------------------------------------------------------------
1 | import { i18n } from '@/plugins/vueI18n'
2 | import { useLocaleStoreWithOut } from '@/store/modules/locale'
3 | import { setHtmlPageLang } from '@/plugins/vueI18n/helper'
4 |
5 | const setI18nLanguage = (locale: LocaleType) => {
6 | const localeStore = useLocaleStoreWithOut()
7 |
8 | if (i18n.mode === 'legacy') {
9 | i18n.global.locale = locale
10 | } else {
11 | ;(i18n.global.locale as any).value = locale
12 | }
13 | localeStore.setCurrentLocale({
14 | lang: locale
15 | })
16 | setHtmlPageLang(locale)
17 | }
18 |
19 | export const useLocale = () => {
20 | // Switching the language will change the locale of useI18n
21 | // And submit to configuration modification
22 | const changeLocale = async (locale: LocaleType) => {
23 | const globalI18n = i18n.global
24 |
25 | const langModule = await import(`../../locales/${locale}.ts`)
26 |
27 | globalI18n.setLocaleMessage(locale, langModule.default)
28 |
29 | setI18nLanguage(locale)
30 | }
31 |
32 | return {
33 | changeLocale
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/config/dto/CfgBaseDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.config.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 通用配置请求类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-04-17 09:12
16 | */
17 | @Data
18 | @ApiModel(value="通用配置", description="通用配置")
19 | public class CfgBaseDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "系统名称")
28 | private String siteName;
29 |
30 | @ApiModelProperty(value = "登录LOGO")
31 | private String loginLogo;
32 |
33 | @ApiModelProperty(value = "登录背景")
34 | private String loginBg;
35 |
36 | @ApiModelProperty(value = "后台LOGO")
37 | private String backLogo;
38 |
39 | @ApiModelProperty(value = "版权信息")
40 | private String copyRight;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/dto/SysDicValueDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 分类字典值数据传输类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-12-01 14:00
16 | */
17 | @Data
18 | @ApiModel(value="分类字典值", description="分类字典值")
19 | public class SysDicValueDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "ID/字典编码", required=true)
25 | private String id;
26 |
27 | @ApiModelProperty(value = "归属字典")
28 | private String dicCode;
29 |
30 | @ApiModelProperty(value = "子项编码")
31 | private String value;
32 |
33 | @ApiModelProperty(value = "分类名称")
34 | private String title;
35 |
36 | @ApiModelProperty(value = "上级ID")
37 | private String parentId;
38 |
39 | @ApiModelProperty(value = "描述")
40 | private String remark;
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/main.ts:
--------------------------------------------------------------------------------
1 | // 引入windi css
2 | import '@/plugins/unocss'
3 |
4 | // 导入全局的svg图标
5 | import '@/plugins/svgIcon'
6 |
7 | // 初始化多语言
8 | import { setupI18n } from '@/plugins/vueI18n'
9 |
10 | // 引入状态管理
11 | import { setupStore } from '@/store'
12 |
13 | // 全局组件
14 | import { setupGlobCom } from '@/components'
15 |
16 | // 引入全局样式
17 | import '@/styles/index.less'
18 |
19 | // 引入动画
20 | import '@/plugins/animate.css'
21 |
22 | // 引入element-plus
23 | import { setupElementPlus } from '@/plugins/elementPlus'
24 |
25 | // 路由
26 | import { setupRouter } from './router'
27 |
28 | // 权限
29 | import { setupPermission } from './directives'
30 |
31 | import { createApp } from 'vue'
32 |
33 | import App from './App.vue'
34 |
35 | import './permission'
36 |
37 | // 创建实例
38 | const setupAll = async () => {
39 | const app = createApp(App)
40 |
41 | await setupI18n(app)
42 |
43 | setupStore(app)
44 |
45 | setupGlobCom(app)
46 |
47 | setupElementPlus(app)
48 |
49 | setupRouter(app)
50 |
51 | setupPermission(app)
52 |
53 | app.mount('#app')
54 | }
55 |
56 | setupAll()
57 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/websocket/CustomSpringConfigurator.java:
--------------------------------------------------------------------------------
1 | package com.yf.config.websocket;
2 |
3 | import org.springframework.beans.BeansException;
4 | import org.springframework.beans.factory.BeanFactory;
5 | import org.springframework.context.ApplicationContext;
6 | import org.springframework.context.ApplicationContextAware;
7 |
8 | import javax.websocket.server.ServerEndpointConfig;
9 |
10 | /**
11 | * 用于获取Spring容器
12 | * @author bool
13 | */
14 | public class CustomSpringConfigurator extends ServerEndpointConfig.Configurator implements ApplicationContextAware {
15 |
16 | /**
17 | * Spring application context.
18 | */
19 | private static volatile BeanFactory context;
20 |
21 | @Override
22 | public T getEndpointInstance(Class clazz) throws InstantiationException {
23 | return context.getBean(clazz);
24 | }
25 |
26 | @Override
27 | public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
28 | CustomSpringConfigurator.context = applicationContext;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/entity/SysDic.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableId;
5 | import com.baomidou.mybatisplus.annotation.TableName;
6 | import com.baomidou.mybatisplus.extension.activerecord.Model;
7 | import lombok.Data;
8 |
9 | /**
10 | *
11 | * 分类字典实体类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-12-01 14:00
16 | */
17 | @Data
18 | @TableName("el_sys_dic")
19 | public class SysDic extends Model {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | /**
24 | * ID
25 | */
26 | @TableId(value = "id", type = IdType.ASSIGN_ID)
27 | private String id;
28 |
29 | /**
30 | * 字典编码
31 | */
32 | private String code;
33 |
34 | /**
35 | * 1分类字典,2数据字典
36 | */
37 | private Integer type;
38 |
39 | /**
40 | * 字典名称
41 | */
42 | private String title;
43 |
44 | /**
45 | * 字典描述
46 | */
47 | private String remark;
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/yf-boot-vue/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "esnext",
4 | "useDefineForClassFields": true,
5 | "module": "esnext",
6 | "moduleResolution": "node",
7 | "strict": true,
8 | "jsx": "preserve",
9 | "sourceMap": true,
10 | "resolveJsonModule": true,
11 | "esModuleInterop": true,
12 | "lib": ["esnext", "dom"],
13 | "baseUrl": "./",
14 | "allowJs": true,
15 | "forceConsistentCasingInFileNames": true,
16 | "allowSyntheticDefaultImports": true,
17 | "strictFunctionTypes": false,
18 | "noUnusedLocals": true,
19 | "noUnusedParameters": true,
20 | "experimentalDecorators": true,
21 | "noImplicitAny": false,
22 | "skipLibCheck": true,
23 | "paths": {
24 | "@/*": ["src/*"]
25 | },
26 | "types": [
27 | "@intlify/unplugin-vue-i18n/types",
28 | "vite/client",
29 | "element-plus/global",
30 | "@types/qrcode",
31 | "vite-plugin-svg-icons/client"
32 | ]
33 | },
34 | "include": ["src", "types/**/*.d.ts", "mock/**/*.ts"]
35 | // "exclude": ["dist", "node_modules"]
36 | }
37 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/SysUserBindDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 | import java.util.Date;
7 |
8 | import java.io.Serializable;
9 |
10 | /**
11 | *
12 | * 登录绑定数据传输类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2021-08-02 14:49
17 | */
18 | @Data
19 | @ApiModel(value="登录绑定", description="登录绑定")
20 | public class SysUserBindDTO implements Serializable {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 |
25 | @ApiModelProperty(value = "ID", required=true)
26 | private String id;
27 |
28 | @ApiModelProperty(value = "用户ID")
29 | private String userId;
30 |
31 | @ApiModelProperty(value = "登录类型")
32 | private String loginType;
33 |
34 | @ApiModelProperty(value = "三方ID")
35 | private String openId;
36 |
37 | @ApiModelProperty(value = "创建时间")
38 | private Date createTime;
39 |
40 | @ApiModelProperty(value = "更新时间")
41 | private Date updateTime;
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/directives/permission/hasPermi.ts:
--------------------------------------------------------------------------------
1 | import type { App, Directive, DirectiveBinding } from 'vue'
2 | import { useI18n } from '@/hooks/web/useI18n'
3 | import router from '@/router'
4 |
5 | const { t } = useI18n()
6 |
7 | const hasPermission = (value: string): boolean => {
8 | const permission = (router.currentRoute.value.meta.permission || []) as string[]
9 | if (!value) {
10 | throw new Error(t('permission.hasPermission'))
11 | }
12 | if (permission.includes(value)) {
13 | return true
14 | }
15 | return false
16 | }
17 | function hasPermi(el: Element, binding: DirectiveBinding) {
18 | const value = binding.value
19 |
20 | const flag = hasPermission(value)
21 | if (!flag) {
22 | el.parentNode?.removeChild(el)
23 | }
24 | }
25 | const mounted = (el: Element, binding: DirectiveBinding) => {
26 | hasPermi(el, binding)
27 | }
28 |
29 | const permiDirective: Directive = {
30 | mounted
31 | }
32 |
33 | export const setupPermissionDirective = (app: App) => {
34 | app.directive('hasPermi', permiDirective)
35 | }
36 |
37 | export default permiDirective
38 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/ability/excel/annotation/ExcelField.java:
--------------------------------------------------------------------------------
1 | package com.yf.ability.excel.annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Excel导出注解定义
10 | * @author bool
11 | */
12 | @Target({ElementType.METHOD, ElementType.FIELD, ElementType.TYPE})
13 | @Retention(RetentionPolicy.RUNTIME)
14 | public @interface ExcelField {
15 |
16 | /**
17 | * 导出的excel标题
18 | * @return
19 | */
20 | String title();
21 |
22 | /**
23 | * 数据过滤,格式如:0=正常,1=禁用
24 | * @return
25 | */
26 | String filter() default "";
27 |
28 | /**
29 | * 导出字段字段排序(升序)
30 | */
31 | int sort() default 0;
32 |
33 | /**
34 | * 日期格式化
35 | * @return
36 | */
37 | String pattern() default "";
38 |
39 | /**
40 | * 数据字典类型
41 | */
42 | String dictCode() default "";
43 |
44 | /**
45 | * 查找字段
46 | * @return
47 | */
48 | String dicText() default "";
49 |
50 | /**
51 | * 查找表
52 | * @return
53 | */
54 | String dictTable() default "";
55 | }
56 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/ImageViewer/index.ts:
--------------------------------------------------------------------------------
1 | import ImageViewer from './src/ImageViewer.vue'
2 | import { isClient } from '@/utils/is'
3 | import { createVNode, render, VNode } from 'vue'
4 | import { ImageViewerProps } from './src/types'
5 |
6 | let instance: Nullable = null
7 |
8 | export function createImageViewer(options: ImageViewerProps) {
9 | if (!isClient) return
10 | const {
11 | urlList,
12 | initialIndex = 0,
13 | infinite = true,
14 | hideOnClickModal = false,
15 | teleported = false,
16 | zIndex = 2000,
17 | show = true
18 | } = options
19 |
20 | const propsData: Partial = {}
21 | const container = document.createElement('div')
22 | propsData.urlList = urlList
23 | propsData.initialIndex = initialIndex
24 | propsData.infinite = infinite
25 | propsData.hideOnClickModal = hideOnClickModal
26 | propsData.teleported = teleported
27 | propsData.zIndex = zIndex
28 | propsData.show = show
29 |
30 | document.body.appendChild(container)
31 | instance = createVNode(ImageViewer, propsData)
32 | render(instance, container)
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/mapper/SysDicValueMapper.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.yf.system.modules.dict.entity.SysDicValue;
5 | import org.apache.ibatis.annotations.Param;
6 |
7 | /**
8 | *
9 | * 分类字典值Mapper
10 | *
11 | *
12 | * @author 聪明笨狗
13 | * @since 2020-12-01 14:00
14 | */
15 | public interface SysDicValueMapper extends BaseMapper {
16 |
17 | /**
18 | * 查找数据字典
19 | * @param dicCode
20 | * @param value
21 | * @return
22 | */
23 | String findDictText(@Param("dicCode") String dicCode, @Param("value") String value);
24 |
25 | /**
26 | * 查找数据字典
27 | * @param dicTable
28 | * @param dicText
29 | * @param dicCode
30 | * @param value
31 | * @return
32 | */
33 | String findTableText(@Param("dicTable") String dicTable,
34 | @Param("dicText") String dicText,
35 | @Param("dicCode") String dicCode,
36 | @Param("value") String value);
37 | }
38 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserUpdateReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto.request;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | * 用户修改请求类
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-04-13 16:57
16 | */
17 | @Data
18 | @ApiModel(value="用户修改请求类", description="用户修改请求类")
19 | public class SysUserUpdateReqDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 |
24 | @ApiModelProperty(value = "头像", required=true)
25 | private String avatar;
26 |
27 | @ApiModelProperty(value = "真实姓名", required=true)
28 | private String realName;
29 |
30 | @ApiModelProperty(value = "密码", required=true)
31 | private String password;
32 |
33 | @ApiModelProperty(value = "身份证号码")
34 | private String idCard;
35 |
36 | @ApiModelProperty(value = "手机号")
37 | private String mobile;
38 |
39 | @ApiModelProperty(value = "邮箱")
40 | private String email;
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/download/temp/DownloadTemp.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils.download.temp;
2 |
3 | import java.util.List;
4 |
5 | /**
6 | * 下载临时文件存储,用于边下载边将已经读取的数据记录下来,保存在文件中,下次读取自动从断点下载。
7 | * @author bool
8 | * @date 2018/8/24 09:02
9 | */
10 | public class DownloadTemp {
11 |
12 | /**
13 | * 下载源URL
14 | */
15 | private String url;
16 | /**
17 | * 文件的总长度
18 | */
19 | private long fileLength;
20 | /**
21 | * 下载的线程列表
22 | */
23 | private List threads;
24 |
25 | public String getUrl() {
26 | return url;
27 | }
28 |
29 | public void setUrl(String url) {
30 | this.url = url;
31 | }
32 |
33 | public long getFileLength() {
34 | return fileLength;
35 | }
36 |
37 | public void setFileLength(long fileLength) {
38 | this.fileLength = fileLength;
39 | }
40 |
41 | public List getThreads() {
42 | return threads;
43 | }
44 |
45 | public void setThreads(List threads) {
46 | this.threads = threads;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/depart/dto/response/SysDepartTreeDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.depart.dto.response;
2 |
3 | import com.yf.system.modules.depart.dto.SysDepartDTO;
4 | import io.swagger.annotations.ApiModel;
5 | import io.swagger.annotations.ApiModelProperty;
6 | import lombok.Data;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | *
12 | * 部门树结构响应类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-09-02 17:25
17 | */
18 | @Data
19 | @ApiModel(value="部门树结构响应类", description="部门树结构响应类")
20 | public class SysDepartTreeDTO extends SysDepartDTO {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | @ApiModelProperty(value = "子列表", required=true)
25 | private List children;
26 |
27 | @ApiModelProperty(value = "前端显示用")
28 | private String text;
29 |
30 | @ApiModelProperty(value = "前端显示用")
31 | private String value;
32 |
33 | public String getText(){
34 | return this.getDeptName();
35 | }
36 |
37 | public String getValue(){
38 | return this.getDeptCode();
39 | }
40 |
41 |
42 |
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/role/service/SysRoleService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.role.service;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.service.IService;
5 | import com.yf.system.modules.role.dto.SysRoleDTO;
6 | import com.yf.system.modules.role.entity.SysRole;
7 | import com.yf.base.api.api.dto.PagingReqDTO;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * 角色业务类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2020-04-13 16:57
18 | */
19 | public interface SysRoleService extends IService {
20 |
21 | /**
22 | * 分页查询数据
23 | * @param reqDTO
24 | * @return
25 | */
26 | IPage paging(PagingReqDTO reqDTO);
27 |
28 | /**
29 | * 查找最大级别的角色
30 | * @param ids
31 | * @return
32 | */
33 | int findMaxLevel(List ids);
34 |
35 | /**
36 | * 保存
37 | * @param reqDTO
38 | */
39 | void save(SysRoleDTO reqDTO);
40 |
41 | /**
42 | * 删除列表
43 | * @param ids
44 | */
45 | void delete(List ids);
46 | }
47 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 孤傲的小笼包
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docker/nginx/conf.d/yf-boot.conf:
--------------------------------------------------------------------------------
1 | server {
2 | listen 8686;
3 | server_name localhost;
4 | # listen 443 ssl;
5 | # ssl_certificate cert/7036742_docker.jeegen.com.pem;
6 | # ssl_certificate_key cert/7036742_docker.jeegen.com.key;
7 | # ssl_session_timeout 5m;
8 | # ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
9 | # ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
10 | # ssl_prefer_server_ciphers on;
11 | proxy_set_header X-Real-IP $remote_addr;
12 | proxy_set_header Host $host;
13 | proxy_http_version 1.1;
14 | proxy_set_header Upgrade $http_upgrade;
15 | proxy_set_header Connection 'upgrade';
16 | client_max_body_size 2000m;
17 | # if ($scheme = http) {
18 | # return 301 https://$host$request_uri;
19 | # }
20 |
21 |
22 | # 动态决定到手机端还是PC端
23 | location / {
24 | root /data/run/dist;
25 | try_files $uri $uri/ /index.html last;
26 | }
27 | location ~/(api/|upload/file/){
28 | proxy_pass http://api:8080;
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/yf-boot-vue/src/styles/index.css:
--------------------------------------------------------------------------------
1 | @import 'var.css';
2 | @import 'element-plus/theme-chalk/dark/css-vars.css';
3 | .el-popup-parent--hidden {
4 | width: 100% !important;
5 | }
6 | .search-box {
7 | height: 50px;
8 | display: flex;
9 | align-items: center;
10 | background: #eee;
11 | padding: 0px 10px 0px 10px;
12 | }
13 | .opt-box {
14 | height: 50px;
15 | display: flex;
16 | align-items: center;
17 | background: #f5f5f5;
18 | padding: 0px 10px 0px 10px;
19 | margin-top: 20px;
20 | }
21 | .opt-box-left {
22 | height: 50px;
23 | display: flex;
24 | align-items: center;
25 | background: #f5f5f5;
26 | flex-grow: 1;
27 | }
28 | .opt-box-right {
29 | height: 50px;
30 | display: flex;
31 | align-items: center;
32 | background: #f5f5f5;
33 | width: 100px;
34 | justify-content: flex-end;
35 | }
36 | .search-items {
37 | display: flex;
38 | align-items: center;
39 | }
40 | .search-items > .filter-item {
41 | margin-right: 10px !important;
42 | width: 200px;
43 | }
44 | .paging-box {
45 | margin-top: 50px;
46 | display: flex;
47 | align-items: center;
48 | justify-content: center;
49 | }
50 | /*# sourceMappingURL=index.css.map */
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/UserRegReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto.request;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 |
9 | /**
10 | *
11 | *
12 | *
13 | *
14 | * @author 聪明笨狗
15 | * @since 2020-04-13 16:57
16 | */
17 | @Data
18 | @ApiModel(value="用户注册请求类", description="用户注册请求类")
19 | public class UserRegReqDTO implements Serializable {
20 |
21 | private static final long serialVersionUID = 1L;
22 |
23 | @ApiModelProperty(value = "帐号", required=true)
24 | private String userName;
25 |
26 | @ApiModelProperty(value = "密码", required=true)
27 | private String password;
28 |
29 | @ApiModelProperty(value = "姓名", required=true)
30 | private String realName;
31 |
32 | @ApiModelProperty(value = "部门", required=true)
33 | private String deptCode;
34 |
35 | @ApiModelProperty(value = "验证码KEY", required=true)
36 | private String captchaKey;
37 |
38 | @ApiModelProperty(value = "验证码值", required=true)
39 | private String captchaValue;
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/resources/mapper/sys/role/SysRoleMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | `id`,`role_name`,`data_scope`,`role_level`,`remark`,`create_time`,`update_time`,`create_by`,`update_by`
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/ability/upload/factory/UploadFactory.java:
--------------------------------------------------------------------------------
1 | package com.yf.ability.upload.factory;
2 |
3 | import com.yf.ability.upload.service.UploadService;
4 | import com.yf.base.utils.SpringUtils;
5 | import com.yf.system.modules.plugin.service.PluginDataService;
6 | import org.springframework.beans.factory.annotation.Autowired;
7 | import org.springframework.stereotype.Service;
8 |
9 | /**
10 | * 服务器端上传文件方法
11 | * @author van
12 | */
13 | @Service
14 | public class UploadFactory {
15 |
16 | /**
17 | * 配置分组
18 | */
19 | private static final String GROUP_ID = "upload";
20 |
21 | @Autowired
22 | private PluginDataService pluginDataService;
23 |
24 | /**
25 | * 获取工厂实例
26 | * @return
27 | */
28 | public UploadService getService(){
29 |
30 | // 获得实现类
31 | String clazz = pluginDataService.findServiceClazz(GROUP_ID);
32 |
33 | System.out.println("+++++服务实现类:"+clazz);
34 |
35 | try {
36 | return (UploadService)SpringUtils.getBean(Class.forName(clazz));
37 | } catch (ClassNotFoundException e) {
38 | throw new RuntimeException(e);
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/ability/shiro/CNFilterFactoryBean.java:
--------------------------------------------------------------------------------
1 | package com.yf.ability.shiro;
2 |
3 | import org.apache.shiro.spring.web.ShiroFilterFactoryBean;
4 | import org.apache.shiro.web.filter.InvalidRequestFilter;
5 | import org.apache.shiro.web.filter.mgt.DefaultFilter;
6 | import org.apache.shiro.web.filter.mgt.FilterChainManager;
7 |
8 | import javax.servlet.Filter;
9 | import java.util.Map;
10 |
11 | /**
12 | * 自定义过滤器,用于处理中文URL问题
13 | * 如:下载文件中包含中文会返回400错误,https://youdomain.com/upload/file/云帆考试系统用户手册.pdf
14 | * @author van
15 | */
16 | public class CNFilterFactoryBean extends ShiroFilterFactoryBean {
17 |
18 | @Override
19 | protected FilterChainManager createFilterChainManager() {
20 | FilterChainManager manager = super.createFilterChainManager();
21 | // URL携带中文400,servletPath中文校验bug
22 | Map filterMap = manager.getFilters();
23 | Filter invalidRequestFilter = filterMap.get(DefaultFilter.invalidRequest.name());
24 | if (invalidRequestFilter instanceof InvalidRequestFilter) {
25 | ((InvalidRequestFilter) invalidRequestFilter).setBlockNonAscii(false);
26 | }
27 | return manager;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/store/modules/lock.ts:
--------------------------------------------------------------------------------
1 | import { defineStore } from 'pinia'
2 | import { store } from '../index'
3 |
4 | interface lockInfo {
5 | isLock?: boolean
6 | password?: string
7 | }
8 |
9 | interface LockState {
10 | lockInfo: lockInfo
11 | }
12 |
13 | export const useLockStore = defineStore('lock', {
14 | state: (): LockState => {
15 | return {
16 | lockInfo: {
17 | // isLock: false, // 是否锁定屏幕
18 | // password: '' // 锁屏密码
19 | }
20 | }
21 | },
22 | getters: {
23 | getLockInfo(): lockInfo {
24 | return this.lockInfo
25 | }
26 | },
27 | actions: {
28 | setLockInfo(lockInfo: lockInfo) {
29 | this.lockInfo = lockInfo
30 | },
31 | resetLockInfo() {
32 | this.lockInfo = {}
33 | },
34 | unLock(password: string) {
35 | if (this.lockInfo?.password === password) {
36 | this.resetLockInfo()
37 | return true
38 | } else {
39 | return false
40 | }
41 | }
42 | },
43 | persist: {
44 | enabled: true,
45 | strategies: [{ key: 'lock', storage: localStorage }]
46 | }
47 | })
48 |
49 | export const useLockStoreWithOut = () => {
50 | return useLockStore(store)
51 | }
52 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/styles/index.less:
--------------------------------------------------------------------------------
1 | @import './var.css';
2 | @import 'element-plus/theme-chalk/dark/css-vars.css';
3 |
4 | // 解决抽屉弹出时,body宽度变化的问题
5 | .el-popup-parent--hidden {
6 | width: 100% !important;
7 | }
8 |
9 | .search-box {
10 | height: 50px;
11 | display: flex;
12 | align-items: center;
13 | background: #eee;
14 | padding: 0px 10px 0px 10px;
15 | }
16 |
17 | .opt-box {
18 | height: 50px;
19 | display: flex;
20 | align-items: center;
21 | background: #f5f5f5;
22 | padding: 0px 10px 0px 10px;
23 | margin-top: 20px;
24 | }
25 |
26 | .opt-box-left {
27 | height: 50px;
28 | display: flex;
29 | align-items: center;
30 | background: #f5f5f5;
31 | flex-grow: 1;
32 | }
33 |
34 | .opt-box-right {
35 | height: 50px;
36 | display: flex;
37 | align-items: center;
38 | background: #f5f5f5;
39 | width: 100px;
40 | justify-content: flex-end;
41 | }
42 |
43 | .search-items {
44 | display: flex;
45 | align-items: center;
46 | }
47 |
48 | .search-items > .filter-item {
49 | margin-right: 10px !important;
50 | width: 200px;
51 | }
52 |
53 | .paging-box {
54 | margin-top: 50px;
55 | display: flex;
56 | align-items: center;
57 | justify-content: center;
58 | }
59 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/ContentWrap/src/ContentWrap.vue:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
19 |
20 |
{{ title }}
21 |
22 |
23 | {{ message }}
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/jackson/RawJsonDeserializer.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils.jackson;
2 |
3 | import com.fasterxml.jackson.core.JsonParser;
4 | import com.fasterxml.jackson.core.JsonProcessingException;
5 | import com.fasterxml.jackson.databind.DeserializationContext;
6 | import com.fasterxml.jackson.databind.JsonDeserializer;
7 | import com.fasterxml.jackson.databind.JsonNode;
8 | import com.fasterxml.jackson.databind.ObjectMapper;
9 |
10 | import java.io.IOException;
11 |
12 | /**
13 | * JSON序列化,从前端接收的对象转换成字符
14 | * @author van
15 | */
16 | public class RawJsonDeserializer extends JsonDeserializer {
17 |
18 | private static final String TYPE_STRING = "STRING";
19 |
20 | @Override
21 | public String deserialize(JsonParser jp, DeserializationContext ctxt)
22 | throws IOException, JsonProcessingException {
23 |
24 | ObjectMapper mapper = (ObjectMapper) jp.getCodec();
25 | JsonNode node = mapper.readTree(jp);
26 |
27 | // 如果本身就是String类型,直接返回
28 | if(TYPE_STRING.equals(node.getNodeType().name())){
29 | return node.textValue();
30 | }
31 |
32 | return mapper.writeValueAsString(node);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/request/SysUserQueryReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto.request;
2 |
3 | import io.swagger.annotations.ApiModel;
4 | import io.swagger.annotations.ApiModelProperty;
5 | import lombok.Data;
6 |
7 | import java.io.Serializable;
8 | import java.util.List;
9 |
10 | /**
11 | *
12 | * 用户搜索请求类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-04-13 16:57
17 | */
18 | @Data
19 | @ApiModel(value="用户搜索请求类", description="用户搜索请求类")
20 | public class SysUserQueryReqDTO implements Serializable {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 |
25 | @ApiModelProperty(value = "角色ID", required=true)
26 | private List roleIds;
27 |
28 | @ApiModelProperty(value = "用户名", required=true)
29 | private String userName;
30 |
31 | @ApiModelProperty(value = "机构编码", required=true)
32 | private String deptCode;
33 |
34 | @ApiModelProperty(value = "排除列表", required=true)
35 | private List excludes;
36 |
37 | @ApiModelProperty(value = "状态", required=true)
38 | private Integer state;
39 |
40 | @ApiModelProperty(value = "手机号码", required=true)
41 | private String mobile;
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/mapper/SysUserMapper.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.baomidou.mybatisplus.core.metadata.IPage;
5 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
6 | import com.yf.system.modules.user.dto.request.SysUserQueryReqDTO;
7 | import com.yf.system.modules.user.dto.response.UserExportDTO;
8 | import com.yf.system.modules.user.dto.response.UserListRespDTO;
9 | import com.yf.system.modules.user.entity.SysUser;
10 | import org.apache.ibatis.annotations.Param;
11 |
12 | import java.util.List;
13 |
14 | /**
15 | *
16 | * 管理用户Mapper
17 | *
18 | *
19 | * @author 聪明笨狗
20 | * @since 2020-04-13 16:57
21 | */
22 | public interface SysUserMapper extends BaseMapper {
23 |
24 | /**
25 | * 查找数据用于导出
26 | * @param reqDTO
27 | * @return
28 | */
29 | List listForExport(@Param("query") SysUserQueryReqDTO reqDTO);
30 |
31 | /**
32 | * 查找用户分页
33 | * @param page
34 | * @param reqDTO
35 | * @return
36 | */
37 | IPage paging(Page page, @Param("query") SysUserQueryReqDTO reqDTO);
38 | }
39 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/dto/response/UserExportDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.dto.response;
2 |
3 | import com.fasterxml.jackson.annotation.JsonIgnore;
4 | import com.yf.ability.excel.annotation.ExcelField;
5 | import lombok.Data;
6 |
7 | /**
8 | * 用于导入导出的用户结构
9 | * @author bool
10 | */
11 | @Data
12 | public class UserExportDTO {
13 |
14 | private static final long serialVersionUID = 1L;
15 |
16 | /**
17 | * 题目ID
18 | */
19 | @JsonIgnore
20 | private String id;
21 |
22 | @ExcelField(title="账号", sort=1)
23 | private String userName;
24 |
25 | @ExcelField(title="姓名", sort=2)
26 | private String realName;
27 |
28 | @ExcelField(title="部门", sort=3, dictTable = "el_sys_depart", dicText = "dept_name", dictCode = "dept_code")
29 | private String deptCode;
30 |
31 | @ExcelField(title="手机", sort=4)
32 | private String mobile;
33 |
34 | @ExcelField(title="邮箱", sort=5)
35 | private String email;
36 |
37 | @ExcelField(title="身份证号", sort=6)
38 | private String idCard;
39 |
40 | @ExcelField(title="角色", sort=8)
41 | private String roleIds;
42 |
43 | @ExcelField(title="密码", sort=9)
44 | private String password;
45 | }
46 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/api/exception/ServiceException.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.api.exception;
2 |
3 |
4 | import com.yf.base.api.api.ApiError;
5 | import com.yf.base.api.api.ApiRest;
6 | import lombok.Data;
7 |
8 |
9 | /**
10 | * 通用异常处理类
11 | * @author bool
12 | */
13 | @Data
14 | public class ServiceException extends RuntimeException{
15 |
16 | /**
17 | * 错误码
18 | */
19 | private Integer code;
20 |
21 | /**
22 | * 错误消息
23 | */
24 | private String msg;
25 |
26 |
27 | /**
28 | * 从结果初始化
29 | * @param apiRest
30 | */
31 | public ServiceException(ApiRest apiRest){
32 | this.code = apiRest.getCode();
33 | this.msg = apiRest.getMsg();
34 | }
35 |
36 | /**
37 | * 从枚举中获取参数
38 | * @param apiError
39 | */
40 | public ServiceException(ApiError apiError){
41 | this.code = apiError.getCode();
42 | this.msg = apiError.msg;
43 | }
44 |
45 | /**
46 | * 通用的错误信息
47 | * @param msg
48 | */
49 | public ServiceException(String msg){
50 | this.code = 1;
51 | this.msg = msg;
52 | }
53 |
54 |
55 | @Override
56 | public String getMessage(){
57 | return this.msg;
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/download/temp/DownloadTempThread.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils.download.temp;
2 |
3 | /**
4 | * 下载线程信息,临时文件的一部分,用于保存各个线程的下载情况。
5 | * @author bool
6 | * @date 2018/8/24 09:03
7 | */
8 | public class DownloadTempThread {
9 |
10 | /**
11 | * 线程名称
12 | */
13 | private String threadName;
14 | /**
15 | * 跳过的字节数
16 | */
17 | private long skip;
18 | /**
19 | * 读取的字节数
20 | */
21 | private long pos;
22 | /**
23 | * 已经加载的数据,用于保存进度
24 | */
25 | private long loaded;
26 |
27 | public String getThreadName() {
28 | return threadName;
29 | }
30 |
31 | public void setThreadName(String threadName) {
32 | this.threadName = threadName;
33 | }
34 |
35 | public long getSkip() {
36 | return skip;
37 | }
38 |
39 | public void setSkip(long skip) {
40 | this.skip = skip;
41 | }
42 |
43 | public long getPos() {
44 | return pos;
45 | }
46 |
47 | public void setPos(long pos) {
48 | this.pos = pos;
49 | }
50 |
51 | public long getLoaded() {
52 | return loaded;
53 | }
54 |
55 | public void setLoaded(long loaded) {
56 | this.loaded = loaded;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/depart/service/SysDepartService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.depart.service;
2 |
3 | import com.baomidou.mybatisplus.extension.service.IService;
4 | import com.yf.system.modules.depart.dto.SysDepartDTO;
5 | import com.yf.system.modules.depart.dto.request.DepartSortReqDTO;
6 | import com.yf.system.modules.depart.dto.response.SysDepartTreeDTO;
7 | import com.yf.system.modules.depart.entity.SysDepart;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * 部门信息业务类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2020-09-02 17:25
18 | */
19 | public interface SysDepartService extends IService {
20 |
21 | /**
22 | * 保存
23 | * @param reqDTO
24 | */
25 | void save(SysDepartDTO reqDTO);
26 |
27 | /**
28 | * 查找部门树结构
29 | * @return
30 | */
31 | List findTree(boolean self);
32 |
33 | /**
34 | * 拖拽排序
35 | * @param reqDTO
36 | */
37 | void sort(DepartSortReqDTO reqDTO);
38 |
39 | /**
40 | * 同步部门信息
41 | * @param str 以逗号隔开的部门
42 | * @return
43 | */
44 | String syncDepart(String str);
45 |
46 | /**
47 | * 删除部门
48 | * @param ids
49 | */
50 | void delete(List ids);
51 | }
52 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/config/axios/index.ts:
--------------------------------------------------------------------------------
1 | import service from './service'
2 |
3 | import config from './config'
4 |
5 | const { defaultHeaders } = config
6 |
7 | const request = (option: AxiosConfig) => {
8 | const { url, method, params, data, headersType, responseType } = option
9 | return service.request({
10 | url: url,
11 | method,
12 | params,
13 | data,
14 | responseType: responseType,
15 | headers: {
16 | 'Content-Type': headersType || defaultHeaders
17 | }
18 | })
19 | }
20 |
21 | export default {
22 | get: (option: AxiosConfig) => {
23 | return request({ method: 'get', ...option }) as Promise>
24 | },
25 | post: (option: AxiosConfig) => {
26 | return request({ method: 'post', ...option }) as Promise>
27 | },
28 | delete: (option: AxiosConfig) => {
29 | return request({ method: 'delete', ...option }) as Promise>
30 | },
31 | put: (option: AxiosConfig) => {
32 | return request({ method: 'put', ...option }) as Promise>
33 | },
34 | cancelRequest: (url: string | string[]) => {
35 | return service.cancelRequest(url)
36 | },
37 | cancelAllRequest: () => {
38 | return service.cancelAllRequest()
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/resources/mapper/sys/dict/SysDicValueMapper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 | `id`,`dic_code`,`value`,`title`,`parent_id`,`remark`
18 |
19 |
20 |
23 |
24 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/api/sys/menu/index.ts:
--------------------------------------------------------------------------------
1 | import request from '@/config/axios'
2 |
3 | export const treeApi = () => {
4 | return request.post({
5 | url: '/api/sys/menu/tree'
6 | })
7 | }
8 |
9 | export const saveApi = (data: any) => {
10 | return request.post({
11 | url: '/api/sys/menu/save',
12 | data
13 | })
14 | }
15 |
16 | export const deleteApi = (data: any) => {
17 | return request.post({
18 | url: '/api/sys/menu/delete',
19 | data
20 | })
21 | }
22 |
23 | export const detailApi = (data: any) => {
24 | return request.post({
25 | url: '/api/sys/menu/detail',
26 | data
27 | })
28 | }
29 |
30 | export const sortApi = (data: any) => {
31 | return request.post({
32 | url: '/api/sys/menu/sort',
33 | data
34 | })
35 | }
36 |
37 | // export const subListApi = (data: any) => {
38 | // return request.post({
39 | // url: '/api/sys/dic/value/tree',
40 | // data
41 | // })
42 | // }
43 |
44 | // export const subSaveApi = (data: any) => {
45 | // return request.post({
46 | // url: '/api/sys/dic/value/save',
47 | // data
48 | // })
49 | // }
50 |
51 | // export const subDeleteApi = (data: any) => {
52 | // return request.post({
53 | // url: '/api/sys/dic/value/delete',
54 | // data
55 | // })
56 | // }
57 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/views/System/Depart/components/DepartSelect.vue:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
61 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/SizeDropdown/src/SizeDropdown.vue:
--------------------------------------------------------------------------------
1 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | {{ t(`size.${item}`) }}
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/jackson/JacksonSerializerModifier.java:
--------------------------------------------------------------------------------
1 | package com.yf.config.jackson;
2 |
3 | import com.fasterxml.jackson.databind.BeanDescription;
4 | import com.fasterxml.jackson.databind.SerializationConfig;
5 | import com.fasterxml.jackson.databind.ser.BeanPropertyWriter;
6 | import com.fasterxml.jackson.databind.ser.BeanSerializerModifier;
7 | import com.yf.base.api.annon.Dict;
8 | import com.yf.system.aspect.dict.DataDictFilter;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * JSON序列化处理器
14 | * @author van
15 | */
16 | public class JacksonSerializerModifier extends BeanSerializerModifier {
17 |
18 | @Override
19 | public List changeProperties(SerializationConfig config, BeanDescription beanDesc, List beanProperties) {
20 | for (BeanPropertyWriter beanProperty : beanProperties) {
21 |
22 | // 数据字典翻译
23 | Dict dict = beanProperty.getAnnotation(Dict.class);
24 | if (dict != null){
25 | DataDictFilter dictFieldSerializer = new DataDictFilter(beanProperty.getName(), dict.dicCode(), dict.dictTable(), dict.dicText());
26 | beanProperty.assignSerializer(dictFieldSerializer);
27 | }
28 | }
29 |
30 |
31 | return beanProperties;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/ability/task/service/JobService.java:
--------------------------------------------------------------------------------
1 | package com.yf.ability.task.service;
2 |
3 | /**
4 | * 任务业务类,用于动态处理任务信息
5 | * @author bool
6 | * @date 2020/11/29 下午2:17
7 | */
8 | public interface JobService {
9 |
10 |
11 | /**
12 | * 任务数据
13 | */
14 | String TASK_DATA = "taskData";
15 |
16 | /**
17 | * 添加定时任务
18 | * @param jobClass
19 | * @param jobName
20 | * @param jobGroup
21 | * @param cron
22 | * @param data
23 | */
24 | void addCronJob(Class jobClass, String jobName, String jobGroup, String cron, String data);
25 |
26 | /**
27 | * 添加立即执行的任务
28 | * @param jobClass
29 | * @param jobName
30 | * @param jobGroup
31 | * @param data
32 | */
33 | void addCronJob(Class jobClass, String jobName, String jobGroup, String data);
34 |
35 | /**
36 | * 暂停任务
37 | * @param jobName
38 | * @param jobGroup
39 | */
40 | void pauseJob(String jobName, String jobGroup);
41 |
42 | /**
43 | * 恢复任务
44 | * @param triggerName
45 | * @param triggerGroup
46 | */
47 | void resumeJob(String triggerName, String triggerGroup);
48 |
49 | /**
50 | * 删除job
51 | * @param jobName
52 | * @param jobGroup
53 | */
54 | void deleteJob(String jobName, String jobGroup);
55 | }
56 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/plugin/service/PluginGroupService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.plugin.service;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.service.IService;
5 | import com.yf.base.api.api.dto.PagingReqDTO;
6 | import com.yf.system.modules.plugin.dto.PluginGroupDTO;
7 | import com.yf.system.modules.plugin.entity.PluginGroup;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * 插件分组业务接口类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2022-09-05 10:05
18 | */
19 | public interface PluginGroupService extends IService {
20 |
21 | /**
22 | * 分页查询数据
23 | * @param reqDTO
24 | * @return
25 | */
26 | IPage paging(PagingReqDTO reqDTO);
27 |
28 | /**
29 | * 添加或保存
30 | * @param reqDTO
31 | * @return
32 | */
33 | void save(PluginGroupDTO reqDTO);
34 |
35 | /**
36 | * 批量删除
37 | * @param ids
38 | * @return
39 | */
40 | void delete(List ids);
41 |
42 | /**
43 | * 查找详情
44 | * @param id
45 | * @return
46 | */
47 | PluginGroupDTO detail(String id);
48 |
49 | /**
50 | * 查找列表
51 | * @param reqDTO
52 | * @return
53 | */
54 | List list(PluginGroupDTO reqDTO);
55 | }
56 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/dict/entity/SysDicValue.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.dict.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 分类字典值实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-12-01 14:00
17 | */
18 | @Data
19 | @TableName("el_sys_dic_value")
20 | public class SysDicValue extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * ID/字典编码
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 归属字典
32 | */
33 | @TableField("dic_code")
34 | private String dicCode;
35 |
36 | /**
37 | * 子项编码
38 | */
39 | @TableField("`value`")
40 | private String value;
41 |
42 | /**
43 | * 分类名称
44 | */
45 | private String title;
46 |
47 | /**
48 | * 上级ID
49 | */
50 | @TableField("parent_id")
51 | private String parentId;
52 |
53 | /**
54 | * 描述
55 | */
56 | private String remark;
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/plugin/service/PluginSchemaService.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.plugin.service;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.IPage;
4 | import com.baomidou.mybatisplus.extension.service.IService;
5 | import com.yf.base.api.api.dto.PagingReqDTO;
6 | import com.yf.system.modules.plugin.dto.PluginSchemaDTO;
7 | import com.yf.system.modules.plugin.entity.PluginSchema;
8 |
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * 插件元数据业务接口类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2022-09-05 10:05
18 | */
19 | public interface PluginSchemaService extends IService {
20 |
21 | /**
22 | * 分页查询数据
23 | * @param reqDTO
24 | * @return
25 | */
26 | IPage paging(PagingReqDTO reqDTO);
27 |
28 | /**
29 | * 添加或保存
30 | * @param reqDTO
31 | * @return
32 | */
33 | void save(PluginSchemaDTO reqDTO);
34 |
35 | /**
36 | * 批量删除
37 | * @param ids
38 | * @return
39 | */
40 | void delete(List ids);
41 |
42 | /**
43 | * 查找详情
44 | * @param id
45 | * @return
46 | */
47 | PluginSchemaDTO detail(String id);
48 |
49 | /**
50 | * 查找列表
51 | * @param reqDTO
52 | * @return
53 | */
54 | List list(PluginSchemaDTO reqDTO);
55 | }
56 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/components/ThemeSwitch/src/ThemeSwitch.vue:
--------------------------------------------------------------------------------
1 |
28 |
29 |
30 |
41 |
42 |
43 |
48 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/utils/FileUtils.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.utils;
2 |
3 | import java.io.File;
4 |
5 | /**
6 | * @author bool
7 | */
8 | public class FileUtils {
9 |
10 | public static boolean checkDelete(String path){
11 |
12 | if(path.contains("/.git/") || path.contains("/target/") || path.contains("/.idea/")){
13 | return true;
14 | }
15 |
16 | return false;
17 | }
18 |
19 |
20 | public static void deleteDir(File file){
21 |
22 | // 文件夹不存在
23 | if(!file.exists() || !file.isDirectory()){
24 | return;
25 | }
26 |
27 |
28 | File [] files = file.listFiles();
29 | if(files == null || files.length==0){
30 | return;
31 | }
32 |
33 | for(File item: files){
34 | if(file.isDirectory()){
35 | deleteDir(item);
36 | continue;
37 | }
38 |
39 |
40 | if(checkDelete(item.getAbsolutePath())){
41 | System.out.println("+++++++++删除文件:"+item.getAbsolutePath());
42 | item.delete();
43 | }
44 | }
45 |
46 | // 删除大文件夹
47 | if(checkDelete(file.getAbsolutePath())){
48 | System.out.println("+++++++++删除文件:"+file.getAbsolutePath());
49 | file.delete();
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/plugins/vueI18n/index.ts:
--------------------------------------------------------------------------------
1 | import type { App } from 'vue'
2 | import { createI18n } from 'vue-i18n'
3 | import { useLocaleStoreWithOut } from '@/store/modules/locale'
4 | import type { I18n, I18nOptions } from 'vue-i18n'
5 | import { setHtmlPageLang } from './helper'
6 |
7 | export let i18n: ReturnType
8 |
9 | const createI18nOptions = async (): Promise => {
10 | const localeStore = useLocaleStoreWithOut()
11 | const locale = localeStore.getCurrentLocale
12 | const localeMap = localeStore.getLocaleMap
13 | const defaultLocal = await import(`../../locales/${locale.lang}.ts`)
14 | const message = defaultLocal.default ?? {}
15 |
16 | setHtmlPageLang(locale.lang)
17 |
18 | localeStore.setCurrentLocale({
19 | lang: locale.lang
20 | // elLocale: elLocal
21 | })
22 |
23 | return {
24 | legacy: false,
25 | locale: locale.lang,
26 | fallbackLocale: locale.lang,
27 | messages: {
28 | [locale.lang]: message
29 | },
30 | availableLocales: localeMap.map((v) => v.lang),
31 | sync: true,
32 | silentTranslationWarn: true,
33 | missingWarn: false,
34 | silentFallbackWarn: true
35 | }
36 | }
37 |
38 | export const setupI18n = async (app: App) => {
39 | const options = await createI18nOptions()
40 | i18n = createI18n(options) as I18n
41 | app.use(i18n)
42 | }
43 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/styles/var.css:
--------------------------------------------------------------------------------
1 | :root {
2 | --login-bg-color: #293146;
3 |
4 | /* left menu start */
5 | --left-menu-max-width: 200px;
6 |
7 | --left-menu-min-width: 64px;
8 |
9 | --left-menu-bg-color: #001529;
10 |
11 | --left-menu-bg-light-color: #0f2438;
12 |
13 | --left-menu-bg-active-color: var(--el-color-primary);
14 |
15 | --left-menu-text-color: #bfcbd9;
16 |
17 | --left-menu-text-active-color: #fff;
18 |
19 | --left-menu-collapse-bg-active-color: var(--el-color-primary);
20 | /* left menu end */
21 |
22 | /* logo start */
23 | --logo-height: 50px;
24 |
25 | --logo-title-text-color: #fff;
26 | /* logo end */
27 |
28 | /* header start */
29 | --top-header-bg-color: '#fff';
30 |
31 | --top-header-text-color: 'inherit';
32 |
33 | --top-header-hover-color: #f6f6f6;
34 |
35 | --top-tool-height: var(--logo-height);
36 |
37 | --top-tool-p-x: 0;
38 |
39 | --tags-view-height: 35px;
40 | /* header start */
41 |
42 | /* tab menu start */
43 | --tab-menu-max-width: 80px;
44 |
45 | --tab-menu-min-width: 30px;
46 |
47 | --tab-menu-collapse-height: 36px;
48 | /* tab menu end */
49 |
50 | --app-content-padding: 20px;
51 |
52 | --app-content-bg-color: #f5f7f9;
53 |
54 | --app-footer-height: 50px;
55 |
56 | --transition-time-02: 0.2s;
57 | }
58 |
59 | .dark {
60 | --app-content-bg-color: var(--el-bg-color);
61 | }
62 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/hooks/web/useNow.ts:
--------------------------------------------------------------------------------
1 | import { dateUtil } from '@/utils/dateUtil'
2 | import { reactive, toRefs } from 'vue'
3 | import { tryOnMounted, tryOnUnmounted } from '@vueuse/core'
4 |
5 | export const useNow = (immediate = true) => {
6 | let timer: IntervalHandle
7 |
8 | const state = reactive({
9 | year: 0,
10 | month: 0,
11 | week: '',
12 | day: 0,
13 | hour: '',
14 | minute: '',
15 | second: 0,
16 | meridiem: ''
17 | })
18 |
19 | const update = () => {
20 | const now = dateUtil()
21 |
22 | const h = now.format('HH')
23 | const m = now.format('mm')
24 | const s = now.get('s')
25 |
26 | state.year = now.get('y')
27 | state.month = now.get('M') + 1
28 | state.week = '星期' + ['日', '一', '二', '三', '四', '五', '六'][now.day()]
29 | state.day = now.get('date')
30 | state.hour = h
31 | state.minute = m
32 | state.second = s
33 |
34 | state.meridiem = now.format('A')
35 | }
36 |
37 | function start() {
38 | update()
39 | clearInterval(timer)
40 | timer = setInterval(() => update(), 1000)
41 | }
42 |
43 | function stop() {
44 | clearInterval(timer)
45 | }
46 |
47 | tryOnMounted(() => {
48 | immediate && start()
49 | })
50 |
51 | tryOnUnmounted(() => {
52 | stop()
53 | })
54 |
55 | return {
56 | ...toRefs(state),
57 | start,
58 | stop
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/api/api/dto/PagingReqDTO.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.api.api.dto;
2 |
3 | import com.baomidou.mybatisplus.core.metadata.OrderItem;
4 | import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
5 | import com.fasterxml.jackson.annotation.JsonIgnore;
6 | import io.swagger.annotations.ApiModel;
7 | import io.swagger.annotations.ApiModelProperty;
8 | import lombok.Data;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * 分页查询类
14 | * @param
15 | * @author bool
16 | */
17 | @ApiModel(value="分页参数", description="分页参数")
18 | @Data
19 | public class PagingReqDTO {
20 |
21 |
22 | @ApiModelProperty(value = "当前页码", required = true, example = "1")
23 | private Integer current;
24 |
25 | @ApiModelProperty(value = "每页数量", required = true, example = "10")
26 | private Integer size;
27 |
28 | @ApiModelProperty(value = "查询参数")
29 | private T params;
30 |
31 | @ApiModelProperty(value = "排序方式")
32 | private List orders;
33 |
34 | @JsonIgnore
35 | @ApiModelProperty(value = "当前用户的ID")
36 | private String userId;
37 |
38 | /**
39 | * 转换成MyBatis的简单分页对象
40 | * @return
41 | */
42 | public Page toPage(){
43 | Page page = new Page();
44 | page.setCurrent(this.current);
45 | page.setSize(this.size);
46 | page.setOrders(orders);
47 | return page;
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/config/entity/CfgBase.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.config.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 |
10 | /**
11 | *
12 | * 通用配置实体类
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-04-17 09:12
17 | */
18 | @Data
19 | @TableName("el_cfg_base")
20 | public class CfgBase extends Model {
21 |
22 | private static final long serialVersionUID = 1L;
23 |
24 | /**
25 | * ID
26 | */
27 | @TableId(value = "id", type = IdType.ASSIGN_ID)
28 | private String id;
29 |
30 | /**
31 | * 系统名称
32 | */
33 | @TableField("site_name")
34 | private String siteName;
35 |
36 | /**
37 | * 登录LOGO
38 | */
39 | @TableField("login_logo")
40 | private String loginLogo;
41 |
42 | /**
43 | * 登录背景
44 | */
45 | @TableField("login_bg")
46 | private String loginBg;
47 |
48 | /**
49 | * 后台LOGO
50 | */
51 | @TableField("back_logo")
52 | private String backLogo;
53 |
54 | /**
55 | * 版权信息
56 | */
57 | @TableField("copy_right")
58 | private String copyRight;
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/config/CorsConfig.java:
--------------------------------------------------------------------------------
1 | package com.yf.config;
2 |
3 | import org.springframework.boot.web.servlet.FilterRegistrationBean;
4 | import org.springframework.context.annotation.Bean;
5 | import org.springframework.context.annotation.Configuration;
6 | import org.springframework.core.Ordered;
7 | import org.springframework.web.cors.CorsConfiguration;
8 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
9 | import org.springframework.web.filter.CorsFilter;
10 |
11 | import java.util.Arrays;
12 |
13 |
14 | /**
15 | * 网关全局设置,允许跨域
16 | * @author bool
17 | * @date 2019-08-13 17:28
18 | */
19 |
20 | @Configuration
21 | public class CorsConfig {
22 |
23 | @Bean
24 | public FilterRegistrationBean corsFilter() {
25 | UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
26 | CorsConfiguration config = new CorsConfiguration();
27 |
28 | config.setAllowCredentials(true);
29 | config.addAllowedOrigin(CorsConfiguration.ALL);
30 | config.addAllowedHeader(CorsConfiguration.ALL);
31 | config.setAllowedMethods(Arrays.asList("POST", "GET", "OPTIONS"));
32 | source.registerCorsConfiguration("/**", config);
33 | FilterRegistrationBean bean = new FilterRegistrationBean<>(new CorsFilter(source));
34 | bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
35 | return bean;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/entity/SysUserBind.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.entity;
2 |
3 | import com.baomidou.mybatisplus.annotation.IdType;
4 | import com.baomidou.mybatisplus.annotation.TableField;
5 | import com.baomidou.mybatisplus.annotation.TableId;
6 | import com.baomidou.mybatisplus.annotation.TableName;
7 | import com.baomidou.mybatisplus.extension.activerecord.Model;
8 | import lombok.Data;
9 | import java.util.Date;
10 |
11 | /**
12 | *
13 | * 登录绑定实体类
14 | *
15 | *
16 | * @author 聪明笨狗
17 | * @since 2021-08-02 14:49
18 | */
19 | @Data
20 | @TableName("el_sys_user_bind")
21 | public class SysUserBind extends Model {
22 |
23 | private static final long serialVersionUID = 1L;
24 |
25 | /**
26 | * ID
27 | */
28 | @TableId(value = "id", type = IdType.ASSIGN_ID)
29 | private String id;
30 |
31 | /**
32 | * 用户ID
33 | */
34 | @TableField("user_id")
35 | private String userId;
36 |
37 | /**
38 | * 登录类型
39 | */
40 | @TableField("login_type")
41 | private String loginType;
42 |
43 | /**
44 | * 三方ID
45 | */
46 | @TableField("open_id")
47 | private String openId;
48 |
49 | /**
50 | * 创建时间
51 | */
52 | @TableField("create_time")
53 | private Date createTime;
54 |
55 | /**
56 | * 更新时间
57 | */
58 | @TableField("update_time")
59 | private Date updateTime;
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/hooks/web/useGuide.ts:
--------------------------------------------------------------------------------
1 | import { Config, driver } from 'driver.js'
2 | import 'driver.js/dist/driver.css'
3 | import { useDesign } from '@/hooks/web/useDesign'
4 | import { useI18n } from '@/hooks/web/useI18n'
5 |
6 | const { t } = useI18n()
7 |
8 | const { variables } = useDesign()
9 |
10 | export const useGuide = (options?: Config) => {
11 | const driverObj = driver(
12 | options || {
13 | showProgress: true,
14 | nextBtnText: t('common.nextLabel'),
15 | prevBtnText: t('common.prevLabel'),
16 | doneBtnText: t('common.doneLabel'),
17 | steps: [
18 | {
19 | element: `#${variables.namespace}-menu`,
20 | popover: {
21 | title: t('common.menu'),
22 | description: t('common.menuDes'),
23 | side: 'right'
24 | }
25 | },
26 | {
27 | element: `#${variables.namespace}-tool-header`,
28 | popover: {
29 | title: t('common.tool'),
30 | description: t('common.toolDes'),
31 | side: 'left'
32 | }
33 | },
34 | {
35 | element: `#${variables.namespace}-tags-view`,
36 | popover: {
37 | title: t('common.tagsView'),
38 | description: t('common.tagsViewDes'),
39 | side: 'bottom'
40 | }
41 | }
42 | ]
43 | }
44 | )
45 |
46 | return {
47 | ...driverObj
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/yf-boot-vue/src/hooks/web/useI18n.ts:
--------------------------------------------------------------------------------
1 | import { i18n } from '@/plugins/vueI18n'
2 |
3 | type I18nGlobalTranslation = {
4 | (key: string): string
5 | (key: string, locale: string): string
6 | (key: string, locale: string, list: unknown[]): string
7 | (key: string, locale: string, named: Record): string
8 | (key: string, list: unknown[]): string
9 | (key: string, named: Record): string
10 | }
11 |
12 | type I18nTranslationRestParameters = [string, any]
13 |
14 | const getKey = (namespace: string | undefined, key: string) => {
15 | if (!namespace) {
16 | return key
17 | }
18 | if (key.startsWith(namespace)) {
19 | return key
20 | }
21 | return `${namespace}.${key}`
22 | }
23 |
24 | export const useI18n = (
25 | namespace?: string
26 | ): {
27 | t: I18nGlobalTranslation
28 | } => {
29 | const normalFn = {
30 | t: (key: string) => {
31 | return getKey(namespace, key)
32 | }
33 | }
34 |
35 | if (!i18n) {
36 | return normalFn
37 | }
38 |
39 | const { t, ...methods } = i18n.global
40 |
41 | const tFn: I18nGlobalTranslation = (key: string, ...arg: any[]) => {
42 | if (!key) return ''
43 | if (!key.includes('.') && !namespace) return key
44 | return (t as any)(getKey(namespace, key), ...(arg as I18nTranslationRestParameters))
45 | }
46 | return {
47 | ...methods,
48 | t: tFn
49 | }
50 | }
51 |
52 | export const t = (key: string) => key
53 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/base/api/api/ApiRest.java:
--------------------------------------------------------------------------------
1 | package com.yf.base.api.api;
2 |
3 |
4 | import com.yf.base.api.exception.ServiceException;
5 | import io.swagger.annotations.ApiModel;
6 | import io.swagger.annotations.ApiModelProperty;
7 | import lombok.Data;
8 | import lombok.NoArgsConstructor;
9 |
10 | /**
11 | * 数据结果返回的封装
12 | * @author bool
13 | * @date 2018/11/20 09:48
14 | */
15 | @Data
16 | @NoArgsConstructor
17 | @ApiModel(value="接口响应", description="接口响应")
18 | public class ApiRest{
19 |
20 | /**
21 | * 响应消息
22 | */
23 | @ApiModelProperty(value = "响应消息")
24 | private String msg;
25 | /**
26 | * 响应代码
27 | */
28 | @ApiModelProperty(value = "响应代码,0为成功,1为失败", required = true)
29 | private Integer code;
30 |
31 | /**
32 | * 请求或响应body
33 | */
34 | @ApiModelProperty(value = "响应内容")
35 | protected T data;
36 |
37 |
38 | /**
39 | * 是否成功
40 | * @return
41 | */
42 | public boolean isSuccess(){
43 | return code.equals(0);
44 | }
45 |
46 | /**
47 | * 构造函数
48 | * @param error
49 | */
50 | public ApiRest(ServiceException error){
51 | this.code = error.getCode();
52 | this.msg = error.getMsg();
53 | }
54 |
55 | /**
56 | * 构造函数
57 | * @param error
58 | */
59 | public ApiRest(ApiError error){
60 | this.code = error.getCode();
61 | this.msg = error.msg;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/yf-boot-api/src/main/java/com/yf/system/modules/user/mapper/SysUserRoleMapper.java:
--------------------------------------------------------------------------------
1 | package com.yf.system.modules.user.mapper;
2 |
3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper;
4 | import com.yf.system.modules.role.entity.SysRole;
5 | import com.yf.system.modules.user.entity.SysUserRole;
6 | import org.apache.ibatis.annotations.Param;
7 |
8 | import java.util.List;
9 |
10 | /**
11 | *
12 | * 用户角色Mapper
13 | *
14 | *
15 | * @author 聪明笨狗
16 | * @since 2020-04-13 16:57
17 | */
18 | public interface SysUserRoleMapper extends BaseMapper {
19 |
20 | /**
21 | * 查找用户的角色列表
22 | * @param userId
23 | * @return
24 | */
25 | List listByUser(@Param("userId") String userId);
26 |
27 | /**
28 | * 查找用户的权限标签
29 | * @param userId
30 | * @return
31 | */
32 | List findUserPermission(@Param("userId") String userId);
33 |
34 | /**
35 | * 查找权限最大的一个角色
36 | * @param userId
37 | * @return
38 | */
39 | SysUserRole findMaxRole(@Param("userId") String userId);
40 |
41 | /**
42 | * 统计数量
43 | * @param userIds
44 | * @param roleLevel
45 | * @return
46 | */
47 | int countWithLevel(@Param("userIds") List userIds, @Param("roleLevel") Integer roleLevel);
48 |
49 |
50 | /**
51 | * 查找最大的角色级别
52 | * @param userId
53 | * @return
54 | */
55 | int findMaxLevel(@Param("userId") String userId);
56 | }
57 |
--------------------------------------------------------------------------------