1 files renamed
18 files modified
| | |
| | | {
|
| | | StringWriter sw = new StringWriter();
|
| | | e.printStackTrace(new PrintWriter(sw, true));
|
| | | String str = sw.toString();
|
| | | return str;
|
| | | return sw.toString();
|
| | | }
|
| | |
|
| | | public static String getRootErrorMessage(Exception e)
|
| | |
| | | *
|
| | | * @param response 渲染对象
|
| | | * @param string 待渲染的字符串
|
| | | * @return null
|
| | | */
|
| | | public static String renderString(HttpServletResponse response, String string)
|
| | | public static void renderString(HttpServletResponse response, String string)
|
| | | {
|
| | | try
|
| | | {
|
| | |
| | | {
|
| | | e.printStackTrace();
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public static boolean isAjaxRequest(HttpServletRequest request)
|
| | | {
|
| | | String accept = request.getHeader("accept");
|
| | | if (accept != null && accept.indexOf("application/json") != -1)
|
| | | if (accept != null && accept.contains("application/json"))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
|
| | | String xRequestedWith = request.getHeader("X-Requested-With");
|
| | | if (xRequestedWith != null && xRequestedWith.indexOf("XMLHttpRequest") != -1)
|
| | | if (xRequestedWith != null && xRequestedWith.contains("XMLHttpRequest"))
|
| | | {
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | String ajax = request.getParameter("__ajax");
|
| | | if (StringUtils.inStringIgnoreCase(ajax, "json", "xml"))
|
| | | {
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | return StringUtils.inStringIgnoreCase(ajax, "json", "xml");
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | /**
|
| | | * 读取文件为字节数据
|
| | | *
|
| | | * @param key 地址
|
| | | * @param url 地址
|
| | | * @return 字节数据
|
| | | */
|
| | | public static byte[] readFile(String url)
|
| | |
| | | if (StringUtils.isNotEmpty(excel.targetAttr()))
|
| | | {
|
| | | String target = excel.targetAttr();
|
| | | if (target.indexOf(".") > -1)
|
| | | if (target.contains("."))
|
| | | {
|
| | | String[] targets = target.split("[.]");
|
| | | for (String name : targets)
|
| | |
| | | for (Object[] os : this.fields)
|
| | | {
|
| | | Excel excel = (Excel) os[1];
|
| | | maxHeight = maxHeight > excel.height() ? maxHeight : excel.height();
|
| | | maxHeight = Math.max(maxHeight, excel.height());
|
| | | }
|
| | | return (short) (maxHeight * 20);
|
| | | }
|
| | |
| | | return;
|
| | | }
|
| | | String[] sqlKeywords = StringUtils.split(SQL_REGEX, "\\|");
|
| | | for (int i = 0; i < sqlKeywords.length; i++)
|
| | | for (String sqlKeyword : sqlKeywords)
|
| | | {
|
| | | if (StringUtils.indexOfIgnoreCase(value, sqlKeywords[i]) > -1)
|
| | | if (StringUtils.indexOfIgnoreCase(value, sqlKeyword) > -1)
|
| | | {
|
| | | throw new UtilException("参数存在SQL注入风险");
|
| | | }
|
| | |
| | | Object cacheObj = SpringUtils.getBean(RedisService.class).getCacheObject(getCacheKey(key));
|
| | | if (StringUtils.isNotNull(cacheObj))
|
| | | {
|
| | | List<SysDictData> dictDatas = StringUtils.cast(cacheObj);
|
| | | return dictDatas;
|
| | | return StringUtils.cast(cacheObj);
|
| | | }
|
| | | return null;
|
| | | }
|
| | |
| | |
|
| | | import java.io.File;
|
| | | import java.io.IOException;
|
| | | import java.util.Objects;
|
| | | import org.apache.commons.io.FilenameUtils;
|
| | | import org.springframework.web.multipart.MultipartFile;
|
| | | import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
| | |
| | | throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
| | | InvalidExtensionException
|
| | | {
|
| | | int fileNamelength = file.getOriginalFilename().length();
|
| | | int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
| | | if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
| | | {
|
| | | throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
| | |
| | |
|
| | | File desc = getAbsoluteFile(baseDir, fileName);
|
| | | file.transferTo(desc);
|
| | | String pathFileName = getPathFileName(fileName);
|
| | | return pathFileName;
|
| | | return getPathFileName(fileName);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | String extension = FilenameUtils.getExtension(file.getOriginalFilename());
|
| | | if (StringUtils.isEmpty(extension))
|
| | | {
|
| | | extension = MimeTypeUtils.getExtension(file.getContentType());
|
| | | extension = MimeTypeUtils.getExtension(Objects.requireNonNull(file.getContentType()));
|
| | | }
|
| | | return extension;
|
| | | }
|
| | |
| | | {
|
| | | int lastIndex = packageName.lastIndexOf(".");
|
| | | int nameLength = packageName.length();
|
| | | String moduleName = StringUtils.substring(packageName, lastIndex + 1, nameLength);
|
| | | return moduleName;
|
| | | return StringUtils.substring(packageName, lastIndex + 1, nameLength);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | int lastIndex = tableName.lastIndexOf("_");
|
| | | int nameLength = tableName.length();
|
| | | String businessName = StringUtils.substring(tableName, lastIndex + 1, nameLength);
|
| | | return businessName;
|
| | | return StringUtils.substring(tableName, lastIndex + 1, nameLength);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public static String getPackagePrefix(String packageName)
|
| | | {
|
| | | int lastIndex = packageName.lastIndexOf(".");
|
| | | String basePackage = StringUtils.substring(packageName, 0, lastIndex);
|
| | | return basePackage;
|
| | | return StringUtils.substring(packageName, 0, lastIndex);
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | {
|
| | | tempList.add(dept.getDeptId());
|
| | | }
|
| | | for (Iterator<SysDept> iterator = depts.iterator(); iterator.hasNext();)
|
| | | for (SysDept dept : depts)
|
| | | {
|
| | | SysDept dept = (SysDept) iterator.next();
|
| | | // 如果是顶级节点, 遍历该父节点的所有子节点
|
| | | if (!tempList.contains(dept.getParentId()))
|
| | | {
|
| | |
| | | */
|
| | | private boolean hasChild(List<SysMenu> list, SysMenu t)
|
| | | {
|
| | | return getChildList(list, t).size() > 0 ? true : false;
|
| | | return getChildList(list, t).size() > 0;
|
| | | }
|
| | |
|
| | | /**
|
| | |
| | | </resultMap>
|
| | |
|
| | | <sql id="selectMenuVo">
|
| | | select menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | from sys_menu
|
| | | </sql>
|
| | |
|
| | |
| | | </select>
|
| | |
|
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
| | | order by m.parent_id, m.order_num
|
| | | </select>
|
| | |
|
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m
|
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id
|
| | | left join sys_user_role ur on rm.role_id = ur.role_id
|
| | |
| | | </select>
|
| | |
|
| | | <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m
|
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id
|
| | | left join sys_user_role ur on rm.role_id = ur.role_id
|
| | |
| | |
|
| | | <!-- 文件列表 -->
|
| | | <transition-group class="upload-file-list el-upload-list el-upload-list--text" name="el-fade-in-linear" tag="ul">
|
| | | <li :key="file.uid" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
| | | <li :key="file.url" class="el-upload-list__item ele-upload-list__item-content" v-for="(file, index) in fileList">
|
| | | <el-link :href="file.url" :underline="false" target="_blank">
|
| | | <span class="el-icon-document"> {{ getFileName(file.name) }} </span>
|
| | | </el-link>
|
| | |
| | | let someSpanIsNot24
|
| | |
|
| | | export function dialogWrapper(str) {
|
| | | return `<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Titile">
|
| | | return `<el-dialog v-bind="$attrs" v-on="$listeners" @open="onOpen" @close="onClose" title="Dialog Title">
|
| | | ${str}
|
| | | <div slot="footer">
|
| | | <el-button @click="close">取消</el-button>
|
| | | <el-button type="primary" @click="handelConfirm">确定</el-button>
|
| | | <el-button type="primary" @click="handleConfirm">确定</el-button>
|
| | | </div>
|
| | | </el-dialog>`
|
| | | }
|
| | |
| | | close: `close() {
|
| | | this.$emit('update:visible', false)
|
| | | },`,
|
| | | handelConfirm: `handelConfirm() {
|
| | | handleConfirm: `handleConfirm() {
|
| | | this.$refs['${confGlobal.formRef}'].validate(valid => {
|
| | | if(!valid) return
|
| | | this.close()
|
| | |
| | | <el-button @click="close">
|
| | | 取消
|
| | | </el-button>
|
| | | <el-button type="primary" @click="handelConfirm">
|
| | | <el-button type="primary" @click="handleConfirm">
|
| | | 确定
|
| | | </el-button>
|
| | | </div>
|
| | |
| | | close(e) {
|
| | | this.$emit('update:visible', false)
|
| | | },
|
| | | handelConfirm() {
|
| | | handleConfirm() {
|
| | | this.$refs.elForm.validate(valid => {
|
| | | if (!valid) return
|
| | | this.$emit('confirm', { ...this.formData })
|
| | |
| | | <div slot="footer">
|
| | | <el-button
|
| | | type="primary"
|
| | | @click="handelConfirm"
|
| | | @click="handleConfirm"
|
| | | >
|
| | | 确定
|
| | | </el-button>
|
| | |
| | | close() {
|
| | | this.$emit('update:visible', false)
|
| | | },
|
| | | handelConfirm() {
|
| | | handleConfirm() {
|
| | | this.$refs.elForm.validate(valid => {
|
| | | if (!valid) return
|
| | | if (this.dataType === 'number') {
|
| | |
| | | import { makeUpHtml, vueTemplate, vueScript, cssStyle } from '@/utils/generator/html'
|
| | | import { makeUpJs } from '@/utils/generator/js'
|
| | | import { makeUpCss } from '@/utils/generator/css'
|
| | | import drawingDefalut from '@/utils/generator/drawingDefalut'
|
| | | import drawingDefault from '@/utils/generator/drawingDefault'
|
| | | import logo from '@/assets/logo/logo.png'
|
| | | import CodeTypeDialog from './CodeTypeDialog'
|
| | | import DraggableItem from './DraggableItem'
|
| | |
| | | selectComponents,
|
| | | layoutComponents,
|
| | | labelWidth: 100,
|
| | | drawingList: drawingDefalut,
|
| | | drawingList: drawingDefault,
|
| | | drawingData: {},
|
| | | activeId: drawingDefalut[0].formId,
|
| | | activeId: drawingDefault[0].formId,
|
| | | drawerVisible: false,
|
| | | formData: {},
|
| | | dialogVisible: false,
|
| | | generateConf: null,
|
| | | showFileName: false,
|
| | | activeData: drawingDefalut[0]
|
| | | activeData: drawingDefault[0]
|
| | | }
|
| | | },
|
| | | created() {
|