发布 4.0.1

This commit is contained in:
疯狂的狮子li
2022-03-01 10:37:26 +08:00
parent 0e81a7c342
commit 2cf283b8c6
50 changed files with 402 additions and 826 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ruoyi-vue-plus",
"version": "4.0.0",
"version": "4.0.1",
"description": "RuoYi-Vue-Plus后台管理系统",
"author": "LionLi",
"license": "MIT",

View File

@ -1,6 +1,7 @@
<template>
<div class="upload-file">
<el-upload
multiple
:action="uploadFileUrl"
:before-upload="handleBeforeUpload"
:file-list="fileList"
@ -69,6 +70,8 @@ export default {
},
data() {
return {
number: 0,
uploadList: [],
baseUrl: process.env.VUE_APP_BASE_API,
uploadFileUrl: process.env.VUE_APP_BASE_API + "/system/oss/upload", // 上传的图片服务器地址
headers: {
@ -122,7 +125,7 @@ export default {
return false;
});
if (!isTypeOk) {
this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
return false;
}
}
@ -130,29 +133,37 @@ export default {
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传文件大小不能超过 ${this.fileSize} MB!`);
this.$modal.msgError(`上传文件大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传文件,请稍候...");
this.number++;
return true;
},
// 文件个数超出
handleExceed() {
this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
// 上传失败
handleUploadError(err) {
this.$message.error("上传失败, 请重试");
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading()
},
// 上传成功回调
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.$message.success("上传成功");
this.fileList.push({ name: res.data.fileName, url: res.data.url });
this.$emit("input", this.listToString(this.fileList));
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
} else {
this.$message.error(res.msg);
this.loading.close();
this.$modal.msgError(res.msg);
this.$modal.closeLoading();
}
},
// 删除文件
@ -163,7 +174,7 @@ export default {
// 获取文件名称
getFileName(name) {
if (name.lastIndexOf("/") > -1) {
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
return name.slice(name.lastIndexOf("/") + 1);
} else {
return "";
}

View File

@ -1,6 +1,7 @@
<template>
<div class="component-upload-image">
<el-upload
multiple
:action="uploadImgUrl"
list-type="picture-card"
:on-success="handleUploadSuccess"
@ -18,7 +19,7 @@
>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip" v-if="showTip">
请上传
@ -70,6 +71,8 @@ export default {
},
data() {
return {
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
@ -121,12 +124,17 @@ export default {
// 上传成功回调
handleUploadSuccess(res) {
if (res.code == 200) {
this.fileList.push({ name: res.data.fileName, url: res.data.url });
this.$emit("input", this.listToString(this.fileList));
this.loading.close();
this.uploadList.push({ name: res.data.fileName, url: res.data.url });
if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
} else {
this.$message.error(res.msg);
this.loading.close();
this.$modal.msgError(res.msg);
this.$modal.closeLoading();
}
},
// 上传前loading加载
@ -147,35 +155,27 @@ export default {
}
if (!isImg) {
this.$message.error(
`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`
);
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$message.error(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.loading = this.$loading({
lock: true,
text: "上传中",
background: "rgba(0, 0, 0, 0.7)",
});
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
// 文件个数超出
handleExceed() {
this.$message.error(`上传文件数量不能超过 ${this.limit} 个!`);
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
},
// 上传失败
handleUploadError(res) {
this.$message({
type: "error",
message: "上传失败",
});
this.loading.close();
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
// 预览
handlePictureCardPreview(file) {

View File

@ -1,7 +1,6 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
v-if="pageShow"
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
@ -64,7 +63,6 @@ export default {
},
data() {
return {
pageShow: true
};
},
computed: {
@ -88,10 +86,7 @@ export default {
methods: {
handleSizeChange(val) {
if (this.currentPage * val > this.total) {
this.pageShow = false;
this.$nextTick(() => {
this.pageShow = true
})
this.currentPage = 1
}
this.$emit('pagination', { page: this.currentPage, limit: val })
if (this.autoScroll) {

View File

@ -4,6 +4,7 @@ import { Message } from 'element-ui'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
import { isRelogin } from '@/utils/request'
NProgress.configure({ showSpinner: false })
@ -19,8 +20,10 @@ router.beforeEach((to, from, next) => {
NProgress.done()
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表

View File

@ -9,7 +9,7 @@ import { saveAs } from 'file-saver'
let downloadLoadingInstance;
// 是否显示重新登录
let isReloginShow;
export let isRelogin = { show: false };
axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'
// 对应国际化资源文件后缀
@ -78,23 +78,20 @@ service.interceptors.response.use(res => {
return res.data
}
if (code === 401) {
if (!isReloginShow) {
isReloginShow = true;
if (!isRelogin.show) {
isRelogin.show = true;
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', {
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
isReloginShow = false;
isRelogin.show = false;
store.dispatch('LogOut').then(() => {
// 如果是登录页面不需要重新加载
if (window.location.hash.indexOf("#/login") != 0) {
location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
}
location.href = process.env.VUE_APP_CONTEXT_PATH + "index";
})
}).catch(() => {
isReloginShow = false;
isRelogin.show = false;
});
}
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')

View File

@ -70,6 +70,9 @@ export function addDateRange(params, dateRange, propName) {
// 回显数据字典
export function selectDictLabel(datas, value) {
if (value === undefined) {
return "";
}
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + value)) {
@ -77,23 +80,31 @@ export function selectDictLabel(datas, value) {
return true;
}
})
if (actions.length === 0) {
actions.push(value);
}
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
if(value === undefined) {
if (value === undefined) {
return "";
}
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
var match = false;
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + temp[val])) {
actions.push(datas[key].label + currentSeparator);
match = true;
}
})
if (!match) {
actions.push(temp[val] + currentSeparator);
}
})
return actions.join('').substring(0, actions.join('').length - 1);
}

View File

@ -101,6 +101,29 @@
<span>更新日志</span>
</div>
<el-collapse accordion>
<el-collapse-item title="v4.0.1 - 2022-03-01">
<ol>
<li>update 图片上传 文件上传 支持并发上传</li>
<li>update 组件ImageUpload支持多图同时选择上传</li>
<li>udpate 组件fileUpload支持多文件同时选择上传</li>
<li>update springboot 2.6.3 => 2.6.4</li>
<li>update hutool 5.7.20 => 5.7.21</li>
<li>update qiniu 7.9.2 => 7.9.3</li>
<li>update minio 8.3.5 => 8.3.7</li>
<li>update 优化 R 默认返回 msg</li>
<li>update 增加 用户注册 用户类型默认值</li>
<li>update 增加用户登出日志</li>
<li>update 更新 多用户多设备的注释说明</li>
<li>update 优化 是否为管理员的判断</li>
<li>update 优化 页面若未匹配到字典标签则返回原字典值</li>
<li>update 调整用户登录 将日志调整到最后 防止获取不到用户警告</li>
<li>update 优化随机数生成方式 避免容易生成两个相同随机数的问题</li>
<li>fix 修复代码生成 基于路径生成 路径为空问题</li>
<li>fix 恢复误删 @Async 注解线程池配置类</li>
<li>fix 修复 minio 适配 https 导致的问题</li>
<li>fix 修复分页组件请求两次问题</li>
</ol>
</el-collapse-item>
<el-collapse-item title="v4.0.0 - 2022-02-18">
<ol>
<li>[重大更新] 重写项目整体结构 数据处理下沉至Mapper符合MVC规范 减少循环依赖</li>
@ -708,7 +731,7 @@ export default {
data() {
return {
// 版本号
version: "4.0.0",
version: "4.0.1",
};
},
methods: {

View File

@ -86,7 +86,8 @@ export default {
password: "",
confirmPassword: "",
code: "",
uuid: ""
uuid: "",
user_type: "sys_user"
},
registerRules: {
username: [

View File

@ -206,7 +206,7 @@ export default {
email: [
{
type: "email",
message: "'请输入正确的邮箱地址",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],

View File

@ -78,7 +78,7 @@
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@ -199,7 +199,7 @@
<el-form-item>
<el-input v-model="form.perms" placeholder="请输入权限标识" maxlength="100" />
<span slot="label">
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasPermi('system:user:list')`)" placement="top">
<el-tooltip content="控制器中定义的权限字符,如:@SaCheckPermission('system:user:list')" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
权限字符

View File

@ -135,7 +135,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="公告类型" prop="noticeType">
<el-select v-model="form.noticeType" placeholder="请选择">
<el-select v-model="form.noticeType" placeholder="请选择公告类型">
<el-option
v-for="dict in dict.type.sys_notice_type"
:key="dict.value"

View File

@ -248,7 +248,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="用户性别">
<el-select v-model="form.sex" placeholder="请选择">
<el-select v-model="form.sex" placeholder="请选择性别">
<el-option
v-for="dict in dict.type.sys_user_sex"
:key="dict.value"
@ -273,7 +273,7 @@
<el-row>
<el-col :span="12">
<el-form-item label="岗位">
<el-select v-model="form.postIds" multiple placeholder="请选择">
<el-select v-model="form.postIds" multiple placeholder="请选择岗位">
<el-option
v-for="item in postOptions"
:key="item.postId"
@ -286,7 +286,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="角色">
<el-select v-model="form.roleIds" multiple placeholder="请选择">
<el-select v-model="form.roleIds" multiple placeholder="请选择角色">
<el-option
v-for="item in roleOptions"
:key="item.roleId"
@ -443,7 +443,7 @@ export default {
email: [
{
type: "email",
message: "'请输入正确的邮箱地址",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],

View File

@ -42,7 +42,7 @@ export default {
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
{
type: "email",
message: "'请输入正确的邮箱地址",
message: "请输入正确的邮箱地址",
trigger: ["blur", "change"]
}
],