update 同步 ruoyi 相关提交
* fix 修复Log注解GET请求记录不到参数问题
* fix 修复某些特性的环境生成代码变乱码TXT文件问题
* update 消除Vue3控制台出现的警告信息
* fix 开启TopNav没有子菜单隐藏侧边栏
* fix 修复回显数据字典数组异常问题(I60UYQ)
* update 忽略不必要的属性数据返回
| | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | /** |
| | | * 搜索值 |
| | | */ |
| | | @JsonIgnore |
| | | @TableField(exist = false) |
| | | private String searchValue; |
| | | |
| | |
| | | /** |
| | | * 请求参数 |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_EMPTY) |
| | | @TableField(exist = false) |
| | | private Map<String, Object> params = new HashMap<>(); |
| | | |
| | |
| | | import org.springframework.web.context.request.RequestContextHolder; |
| | | import org.springframework.web.context.request.ServletRequestAttributes; |
| | | |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.servlet.http.HttpSession; |
| | |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Collections; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 客户端工具类 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获得所有请求参数 |
| | | * |
| | | * @param request 请求对象{@link ServletRequest} |
| | | * @return Map |
| | | */ |
| | | public static Map<String, String[]> getParams(ServletRequest request) { |
| | | final Map<String, String[]> map = request.getParameterMap(); |
| | | return Collections.unmodifiableMap(map); |
| | | } |
| | | |
| | | /** |
| | | * 获得所有请求参数 |
| | | * |
| | | * @param request 请求对象{@link ServletRequest} |
| | | * @return Map |
| | | */ |
| | | public static Map<String, String> getParamMap(ServletRequest request) { |
| | | Map<String, String> params = new HashMap<>(); |
| | | for (Map.Entry<String, String[]> entry : getParams(request).entrySet()) { |
| | | params.put(entry.getKey(), StringUtils.join(entry.getValue(), ",")); |
| | | } |
| | | return params; |
| | | } |
| | | |
| | | /** |
| | | * 获取request |
| | | */ |
| | | public static HttpServletRequest getRequest() { |
| | |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.validation.BindingResult; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.servlet.HandlerMapping; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | SpringUtils.getBean(OperLogService.class).recordOper(operLog); |
| | | } catch (Exception exp) { |
| | | // 记录本地异常日志 |
| | | log.error("==前置通知异常=="); |
| | | log.error("异常信息:{}", exp.getMessage()); |
| | | exp.printStackTrace(); |
| | | } |
| | |
| | | String params = argsArrayToString(joinPoint.getArgs()); |
| | | operLog.setOperParam(StringUtils.substring(params, 0, 2000)); |
| | | } else { |
| | | Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); |
| | | operLog.setOperParam(StringUtils.substring(paramsMap.toString(), 0, 2000)); |
| | | Map<String, String> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest()); |
| | | MapUtil.removeAny(paramsMap, EXCLUDE_PROPERTIES); |
| | | operLog.setOperParam(StringUtils.substring(JsonUtils.toJsonString(paramsMap), 0, 2000)); |
| | | } |
| | | } |
| | | |
| | |
| | | #end |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | type="text" |
| | | icon="Edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['${moduleName}:${businessName}:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="Plus" |
| | | @click="handleAdd(scope.row)" |
| | | v-hasPermi="['${moduleName}:${businessName}:add']" |
| | | >新增</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="Delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['${moduleName}:${businessName}:remove']" |
| | | >删除</el-button> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | #end |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | type="text" |
| | | icon="Edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['${moduleName}:${businessName}:edit']" |
| | | >修改</el-button> |
| | | <el-button |
| | | type="text" |
| | | icon="Delete" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['${moduleName}:${businessName}:remove']" |
| | | >删除</el-button> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | if (path !== undefined && path.lastIndexOf("/") > 0 && hideList.indexOf(path) === -1) { |
| | | const tmpPath = path.substring(1, path.length); |
| | | activePath = "/" + tmpPath.substring(0, tmpPath.indexOf("/")); |
| | | this.$store.dispatch('app/toggleSideBarHide', false); |
| | | if (!this.$route.meta.link) { |
| | | this.$store.dispatch('app/toggleSideBarHide', false); |
| | | } |
| | | } else if(!this.$route.children) { |
| | | activePath = path; |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | |
| | | } |
| | | if(routes.length > 0) { |
| | | this.$store.commit("SET_SIDEBAR_ROUTERS", routes); |
| | | } else { |
| | | this.$store.dispatch('app/toggleSideBarHide', true); |
| | | } |
| | | }, |
| | | ishttp(url) { |
| | |
| | | if (code === 401) { |
| | | if (!isRelogin.show) { |
| | | isRelogin.show = true; |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { |
| | | confirmButtonText: '重新登录', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | } |
| | | ).then(() => { |
| | | MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { |
| | | isRelogin.show = false; |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = process.env.VUE_APP_CONTEXT_PATH + "index"; |
| | |
| | | } |
| | | return Promise.reject('无效的会话,或者会话已过期,请重新登录。') |
| | | } else if (code === 500) { |
| | | Message({ |
| | | message: msg, |
| | | type: 'error' |
| | | }) |
| | | Message({ message: msg, type: 'error' }) |
| | | return Promise.reject(new Error(msg)) |
| | | } else if (code === 601) { |
| | | Message({ |
| | | message: msg, |
| | | type: 'warning' |
| | | }) |
| | | Message({ message: msg, type: 'warning' }) |
| | | return Promise.reject('error') |
| | | } else if (code !== 200) { |
| | | Notification.error({ |
| | | title: msg |
| | | }) |
| | | Notification.error({ title: msg }) |
| | | return Promise.reject('error') |
| | | } else { |
| | | return res.data |
| | |
| | | let { message } = error; |
| | | if (message == "Network Error") { |
| | | message = "后端接口连接异常"; |
| | | } |
| | | else if (message.includes("timeout")) { |
| | | } else if (message.includes("timeout")) { |
| | | message = "系统接口请求超时"; |
| | | } |
| | | else if (message.includes("Request failed with status code")) { |
| | | } else if (message.includes("Request failed with status code")) { |
| | | message = "系统接口" + message.substr(message.length - 3) + "异常"; |
| | | } |
| | | Message({ |
| | | message: message, |
| | | type: 'error', |
| | | duration: 5 * 1000 |
| | | }) |
| | | Message({ message: message, type: 'error', duration: 5 * 1000 }) |
| | | return Promise.reject(error) |
| | | } |
| | | ) |
| | |
| | | return actions.join(''); |
| | | } |
| | | |
| | | // 回显数据字典(字符串数组) |
| | | // 回显数据字典(字符串、数组) |
| | | export function selectDictLabels(datas, value, separator) { |
| | | if (value === undefined) { |
| | | if (value === undefined || value.length ===0) { |
| | | return ""; |
| | | } |
| | | if (Array.isArray(value)) { |
| | | value = value.join(","); |
| | | } |
| | | var actions = []; |
| | | var currentSeparator = undefined === separator ? "," : separator; |
| | | var temp = value.split(currentSeparator); |
| | |
| | | this.$modal.msgSuccess("成功生成到自定义路径:" + row.genPath); |
| | | }); |
| | | } else { |
| | | this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi"); |
| | | this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip"); |
| | | } |
| | | }, |
| | | /** 同步数据库操作 */ |