Merge branch 'master' of https://gitee.com/y_project/RuoYi-Cloud
This commit is contained in:
commit
15fe593cdb
2
pom.xml
2
pom.xml
|
|
@ -27,7 +27,7 @@
|
||||||
<tobato.version>1.26.5</tobato.version>
|
<tobato.version>1.26.5</tobato.version>
|
||||||
<kaptcha.version>2.3.2</kaptcha.version>
|
<kaptcha.version>2.3.2</kaptcha.version>
|
||||||
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
<pagehelper.boot.version>1.3.0</pagehelper.boot.version>
|
||||||
<druid.version>1.2.2</druid.version>
|
<druid.version>1.2.4</druid.version>
|
||||||
<dynamic-ds.version>3.2.1</dynamic-ds.version>
|
<dynamic-ds.version>3.2.1</dynamic-ds.version>
|
||||||
<commons.io.version>2.5</commons.io.version>
|
<commons.io.version>2.5</commons.io.version>
|
||||||
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
<commons.fileupload.version>1.3.3</commons.fileupload.version>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,8 @@ public class SecurityUtils
|
||||||
*/
|
*/
|
||||||
public static String getUsername()
|
public static String getUsername()
|
||||||
{
|
{
|
||||||
return ServletUtils.getRequest().getHeader(CacheConstants.DETAILS_USERNAME);
|
String username = ServletUtils.getRequest().getHeader(CacheConstants.DETAILS_USERNAME);
|
||||||
|
return ServletUtils.urlDecode(username);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.ruoyi.common.core.utils;
|
package com.ruoyi.common.core.utils;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.net.URLEncoder;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
@ -10,6 +13,7 @@ import javax.servlet.http.HttpSession;
|
||||||
import org.springframework.web.context.request.RequestAttributes;
|
import org.springframework.web.context.request.RequestAttributes;
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
import com.ruoyi.common.core.text.Convert;
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -173,4 +177,40 @@ public class ServletUtils
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容编码
|
||||||
|
*
|
||||||
|
* @param str 内容
|
||||||
|
* @return 编码后的内容
|
||||||
|
*/
|
||||||
|
public static String urlEncode(String str)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return URLEncoder.encode(str, Constants.UTF8);
|
||||||
|
}
|
||||||
|
catch (UnsupportedEncodingException e)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容解码
|
||||||
|
*
|
||||||
|
* @param str 内容
|
||||||
|
* @return 解码后的内容
|
||||||
|
*/
|
||||||
|
public static String urlDecode(String str)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return URLDecoder.decode(str, Constants.UTF8);
|
||||||
|
}
|
||||||
|
catch (UnsupportedEncodingException e)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import org.springframework.http.HttpMethod;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.utils.SecurityUtils;
|
||||||
import com.ruoyi.common.core.utils.ServletUtils;
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.core.utils.ip.IpUtils;
|
import com.ruoyi.common.core.utils.ip.IpUtils;
|
||||||
|
|
@ -93,8 +93,7 @@ public class LogAspect
|
||||||
operLog.setJsonResult(JSON.toJSONString(jsonResult));
|
operLog.setJsonResult(JSON.toJSONString(jsonResult));
|
||||||
|
|
||||||
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
operLog.setOperUrl(ServletUtils.getRequest().getRequestURI());
|
||||||
HttpServletRequest request = ServletUtils.getRequest();
|
String username = SecurityUtils.getUsername();
|
||||||
String username = request.getHeader(CacheConstants.DETAILS_USERNAME);
|
|
||||||
if (StringUtils.isNotBlank(username))
|
if (StringUtils.isNotBlank(username))
|
||||||
{
|
{
|
||||||
operLog.setOperName(username);
|
operLog.setOperName(username);
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||||
import com.ruoyi.common.core.constant.CacheConstants;
|
import com.ruoyi.common.core.constant.CacheConstants;
|
||||||
import com.ruoyi.common.core.constant.Constants;
|
import com.ruoyi.common.core.constant.Constants;
|
||||||
import com.ruoyi.common.core.domain.R;
|
import com.ruoyi.common.core.domain.R;
|
||||||
|
import com.ruoyi.common.core.utils.ServletUtils;
|
||||||
import com.ruoyi.common.core.utils.StringUtils;
|
import com.ruoyi.common.core.utils.StringUtils;
|
||||||
import com.ruoyi.common.redis.service.RedisService;
|
import com.ruoyi.common.redis.service.RedisService;
|
||||||
import com.ruoyi.gateway.config.properties.IgnoreWhiteProperties;
|
import com.ruoyi.gateway.config.properties.IgnoreWhiteProperties;
|
||||||
|
|
@ -78,7 +79,7 @@ public class AuthFilter implements GlobalFilter, Ordered
|
||||||
redisService.expire(getTokenKey(token), EXPIRE_TIME);
|
redisService.expire(getTokenKey(token), EXPIRE_TIME);
|
||||||
// 设置用户信息到请求
|
// 设置用户信息到请求
|
||||||
ServerHttpRequest mutableReq = exchange.getRequest().mutate().header(CacheConstants.DETAILS_USER_ID, userid)
|
ServerHttpRequest mutableReq = exchange.getRequest().mutate().header(CacheConstants.DETAILS_USER_ID, userid)
|
||||||
.header(CacheConstants.DETAILS_USERNAME, username).build();
|
.header(CacheConstants.DETAILS_USERNAME, ServletUtils.urlEncode(username)).build();
|
||||||
ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build();
|
ServerWebExchange mutableExchange = exchange.mutate().request(mutableReq).build();
|
||||||
|
|
||||||
return chain.filter(mutableExchange);
|
return chain.filter(mutableExchange);
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "fileUpload")
|
#elseif($column.htmlType == "fileUpload")
|
||||||
<el-form-item label="${comment}">
|
<el-form-item label="${comment}">
|
||||||
<imageUpload v-model="form.${field}"/>
|
<fileUpload v-model="form.${field}"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "editor")
|
#elseif($column.htmlType == "editor")
|
||||||
<el-form-item label="${comment}">
|
<el-form-item label="${comment}">
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ export default {
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.fileList = [];
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -7,31 +7,74 @@
|
||||||
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
|
||||||
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
|
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
|
<el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
|
||||||
|
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" />
|
||||||
|
</el-tooltip>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-dialog :title="title" :visible.sync="open" append-to-body>
|
||||||
|
<el-transfer
|
||||||
|
:titles="['显示', '隐藏']"
|
||||||
|
v-model="value"
|
||||||
|
:data="columns"
|
||||||
|
@change="dataChange"
|
||||||
|
></el-transfer>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
name: "RightToolbar",
|
name: "RightToolbar",
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
// 显隐数据
|
||||||
|
value: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "显示/隐藏",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
showSearch: {
|
showSearch: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
columns: {
|
||||||
|
type: Array,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//搜索
|
// 搜索
|
||||||
toggleSearch() {
|
toggleSearch() {
|
||||||
this.$emit("update:showSearch", !this.showSearch);
|
this.$emit("update:showSearch", !this.showSearch);
|
||||||
},
|
},
|
||||||
//刷新
|
// 刷新
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$emit("queryTable");
|
this.$emit("queryTable");
|
||||||
},
|
},
|
||||||
|
// 右侧列表元素变化
|
||||||
|
dataChange(data) {
|
||||||
|
for (var item in this.columns) {
|
||||||
|
const key = this.columns[item].key;
|
||||||
|
this.columns[item].visible = !data.includes(key);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 打开显隐列dialog
|
||||||
|
showColumn() {
|
||||||
|
this.open = true;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
::v-deep .el-transfer__button {
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 12px;
|
||||||
|
display: block;
|
||||||
|
margin-left: 0px;
|
||||||
|
}
|
||||||
|
::v-deep .el-transfer__button:first-child {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
import Vue from 'vue'
|
|
||||||
const global = new Vue()
|
|
||||||
export default global
|
|
||||||
|
|
@ -135,17 +135,17 @@
|
||||||
v-hasPermi="['system:user:export']"
|
v-hasPermi="['system:user:export']"
|
||||||
>导出</el-button>
|
>导出</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
<el-table-column label="用户编号" align="center" prop="userId" />
|
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
|
||||||
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" />
|
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="用户昵称" align="center" prop="nickName" :show-overflow-tooltip="true" />
|
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="部门" align="center" prop="dept.deptName" :show-overflow-tooltip="true" />
|
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="手机号码" align="center" prop="phonenumber" width="120" />
|
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" />
|
||||||
<el-table-column label="状态" align="center">
|
<el-table-column label="状态" align="center" key="status" v-if="columns[5].visible">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.status"
|
v-model="scope.row.status"
|
||||||
|
|
@ -155,7 +155,7 @@
|
||||||
></el-switch>
|
></el-switch>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="160">
|
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[6].visible" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
|
@ -418,6 +418,16 @@ export default {
|
||||||
status: undefined,
|
status: undefined,
|
||||||
deptId: undefined
|
deptId: undefined
|
||||||
},
|
},
|
||||||
|
// 列信息
|
||||||
|
columns: [
|
||||||
|
{ key: 0, label: `用户编号`, visible: true },
|
||||||
|
{ key: 1, label: `用户名称`, visible: true },
|
||||||
|
{ key: 2, label: `用户昵称`, visible: true },
|
||||||
|
{ key: 3, label: `部门`, visible: true },
|
||||||
|
{ key: 4, label: `手机号码`, visible: true },
|
||||||
|
{ key: 5, label: `状态`, visible: true },
|
||||||
|
{ key: 6, label: `创建时间`, visible: true }
|
||||||
|
],
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
userName: [
|
userName: [
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue