Merge branch 'master' of https://gitee.com/y_project/RuoYi-Cloud
This commit is contained in:
commit
5371bf0082
|
|
@ -812,7 +812,7 @@ public class ExcelUtil<T>
|
||||||
*/
|
*/
|
||||||
private Object getValue(Object o, String name) throws Exception
|
private Object getValue(Object o, String name) throws Exception
|
||||||
{
|
{
|
||||||
if (StringUtils.isNotEmpty(name))
|
if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name))
|
||||||
{
|
{
|
||||||
Class<?> clazz = o.getClass();
|
Class<?> clazz = o.getClass();
|
||||||
Field field = clazz.getDeclaredField(name);
|
Field field = clazz.getDeclaredField(name);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.ruoyi.common.log.aspect;
|
package com.ruoyi.common.log.aspect;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import org.aspectj.lang.JoinPoint;
|
import org.aspectj.lang.JoinPoint;
|
||||||
|
|
@ -209,8 +212,31 @@ public class LogAspect
|
||||||
* @param o 对象信息。
|
* @param o 对象信息。
|
||||||
* @return 如果是需要过滤的对象,则返回true;否则返回false。
|
* @return 如果是需要过滤的对象,则返回true;否则返回false。
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public boolean isFilterObject(final Object o)
|
public boolean isFilterObject(final Object o)
|
||||||
{
|
{
|
||||||
|
Class<?> clazz = o.getClass();
|
||||||
|
if (clazz.isArray())
|
||||||
|
{
|
||||||
|
return clazz.getComponentType().isAssignableFrom(MultipartFile.class);
|
||||||
|
}
|
||||||
|
else if (Collection.class.isAssignableFrom(clazz))
|
||||||
|
{
|
||||||
|
Collection collection = (Collection) o;
|
||||||
|
for (Iterator iter = collection.iterator(); iter.hasNext();)
|
||||||
|
{
|
||||||
|
return iter.next() instanceof MultipartFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (Map.class.isAssignableFrom(clazz))
|
||||||
|
{
|
||||||
|
Map map = (Map) o;
|
||||||
|
for (Iterator iter = map.entrySet().iterator(); iter.hasNext();)
|
||||||
|
{
|
||||||
|
Map.Entry entry = (Map.Entry) iter.next();
|
||||||
|
return entry.getValue() instanceof MultipartFile;
|
||||||
|
}
|
||||||
|
}
|
||||||
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
|
return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
package com.ruoyi.common.redis.service;
|
package com.ruoyi.common.redis.service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.data.redis.core.BoundSetOperations;
|
||||||
import org.springframework.data.redis.core.HashOperations;
|
import org.springframework.data.redis.core.HashOperations;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.data.redis.core.ValueOperations;
|
import org.springframework.data.redis.core.ValueOperations;
|
||||||
|
|
@ -136,10 +138,15 @@ public class RedisService
|
||||||
* @param dataSet 缓存的数据
|
* @param dataSet 缓存的数据
|
||||||
* @return 缓存数据的对象
|
* @return 缓存数据的对象
|
||||||
*/
|
*/
|
||||||
public <T> long setCacheSet(final String key, final Set<T> dataSet)
|
public <T> BoundSetOperations<String, T> setCacheSet(final String key, final Set<T> dataSet)
|
||||||
{
|
{
|
||||||
Long count = redisTemplate.opsForSet().add(key, dataSet);
|
BoundSetOperations<String, T> setOperation = redisTemplate.boundSetOps(key);
|
||||||
return count == null ? 0 : count;
|
Iterator<T> it = dataSet.iterator();
|
||||||
|
while (it.hasNext())
|
||||||
|
{
|
||||||
|
setOperation.add(it.next());
|
||||||
|
}
|
||||||
|
return setOperation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -171,11 +171,13 @@ public class SysUserController extends BaseController
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
else if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||||
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
else if (StringUtils.isNotEmpty(user.getEmail())
|
||||||
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return AjaxResult.error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
|
|
@ -193,11 +195,13 @@ public class SysUserController extends BaseController
|
||||||
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
public AjaxResult edit(@Validated @RequestBody SysUser user)
|
||||||
{
|
{
|
||||||
userService.checkUserAllowed(user);
|
userService.checkUserAllowed(user);
|
||||||
if (UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
if (StringUtils.isNotEmpty(user.getPhonenumber())
|
||||||
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
else if (UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
else if (StringUtils.isNotEmpty(user.getEmail())
|
||||||
|
&& UserConstants.NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
|
||||||
{
|
{
|
||||||
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
return AjaxResult.error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@
|
||||||
"element-ui": "2.14.1",
|
"element-ui": "2.14.1",
|
||||||
"file-saver": "2.0.4",
|
"file-saver": "2.0.4",
|
||||||
"fuse.js": "6.4.3",
|
"fuse.js": "6.4.3",
|
||||||
|
"highlight.js": "10.4.1",
|
||||||
"js-beautify": "1.13.0",
|
"js-beautify": "1.13.0",
|
||||||
"js-cookie": "2.2.1",
|
"js-cookie": "2.2.1",
|
||||||
"jsencrypt": "3.0.0-rc.1",
|
"jsencrypt": "3.0.0-rc.1",
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,11 @@ import { getDicts } from "@/api/system/dict/data";
|
||||||
import { getConfigKey } from "@/api/system/config";
|
import { getConfigKey } from "@/api/system/config";
|
||||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
|
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
|
||||||
import Pagination from "@/components/Pagination";
|
import Pagination from "@/components/Pagination";
|
||||||
//自定义表格工具扩展
|
// 自定义表格工具扩展
|
||||||
import RightToolbar from "@/components/RightToolbar"
|
import RightToolbar from "@/components/RightToolbar"
|
||||||
|
// 代码高亮插件
|
||||||
|
import hljs from 'highlight.js'
|
||||||
|
import 'highlight.js/styles/github-gist.css'
|
||||||
|
|
||||||
// 全局方法挂载
|
// 全局方法挂载
|
||||||
Vue.prototype.getDicts = getDicts
|
Vue.prototype.getDicts = getDicts
|
||||||
|
|
@ -50,6 +53,7 @@ Vue.component('Pagination', Pagination)
|
||||||
Vue.component('RightToolbar', RightToolbar)
|
Vue.component('RightToolbar', RightToolbar)
|
||||||
|
|
||||||
Vue.use(permission)
|
Vue.use(permission)
|
||||||
|
Vue.use(hljs.vuePlugin);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If you don't want to use mock-server
|
* If you don't want to use mock-server
|
||||||
|
|
|
||||||
|
|
@ -421,14 +421,10 @@ export default {
|
||||||
nickName: [
|
nickName: [
|
||||||
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
{ required: true, message: "用户昵称不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
deptId: [
|
|
||||||
{ required: true, message: "归属部门不能为空", trigger: "blur" }
|
|
||||||
],
|
|
||||||
password: [
|
password: [
|
||||||
{ required: true, message: "用户密码不能为空", trigger: "blur" }
|
{ required: true, message: "用户密码不能为空", trigger: "blur" }
|
||||||
],
|
],
|
||||||
email: [
|
email: [
|
||||||
{ required: true, message: "邮箱地址不能为空", trigger: "blur" },
|
|
||||||
{
|
{
|
||||||
type: "email",
|
type: "email",
|
||||||
message: "'请输入正确的邮箱地址",
|
message: "'请输入正确的邮箱地址",
|
||||||
|
|
@ -436,7 +432,6 @@ export default {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
phonenumber: [
|
phonenumber: [
|
||||||
{ required: true, message: "手机号码不能为空", trigger: "blur" },
|
|
||||||
{
|
{
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
message: "请输入正确的手机号码",
|
message: "请输入正确的手机号码",
|
||||||
|
|
|
||||||
|
|
@ -91,21 +91,21 @@
|
||||||
align="center"
|
align="center"
|
||||||
prop="tableName"
|
prop="tableName"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
width="130"
|
width="120"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="表描述"
|
label="表描述"
|
||||||
align="center"
|
align="center"
|
||||||
prop="tableComment"
|
prop="tableComment"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
width="130"
|
width="120"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="实体"
|
label="实体"
|
||||||
align="center"
|
align="center"
|
||||||
prop="className"
|
prop="className"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
width="130"
|
width="120"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
<el-table-column label="创建时间" align="center" prop="createTime" width="160" />
|
||||||
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
<el-table-column label="更新时间" align="center" prop="updateTime" width="160" />
|
||||||
|
|
@ -159,13 +159,13 @@
|
||||||
<!-- 预览界面 -->
|
<!-- 预览界面 -->
|
||||||
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body>
|
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body>
|
||||||
<el-tabs v-model="preview.activeName">
|
<el-tabs v-model="preview.activeName">
|
||||||
<el-tab-pane style="overflow-x: scroll;"
|
<el-tab-pane
|
||||||
v-for="(value, key) in preview.data"
|
v-for="(value, key) in preview.data"
|
||||||
:label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
:label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
||||||
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
||||||
:key="key"
|
:key="key"
|
||||||
>
|
>
|
||||||
<pre>{{ value }}</pre>
|
<highlightjs autodetect :code="value" />
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
@ -177,6 +177,7 @@
|
||||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
||||||
import importTable from "./importTable";
|
import importTable from "./importTable";
|
||||||
import { downLoadZip } from "@/utils/zipdownload";
|
import { downLoadZip } from "@/utils/zipdownload";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Gen",
|
name: "Gen",
|
||||||
components: { importTable },
|
components: { importTable },
|
||||||
|
|
@ -256,7 +257,7 @@ export default {
|
||||||
this.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
this.msgSuccess("成功生成到自定义路径:" + row.genPath);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
downLoadZip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi");
|
downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue