| | |
| | |
|
| | | /**
|
| | | * 转换为boolean<br>
|
| | | * String支持的值为:true、false、yes、ok、no,1,0 如果给定的值为空,或者转换失败,返回默认值<br>
|
| | | * String支持的值为:true、false、yes、ok、no、1、0、是、否, 如果给定的值为空,或者转换失败,返回默认值<br>
|
| | | * 转换失败不会报错
|
| | | *
|
| | | * @param value 被转换的值
|
| | |
| | | case "yes":
|
| | | case "ok":
|
| | | case "1":
|
| | | case "是":
|
| | | return true;
|
| | | case "false":
|
| | | case "no":
|
| | | case "0":
|
| | | case "否":
|
| | | return false;
|
| | | default:
|
| | | return defaultValue;
|
| | |
| | | * @param list 列表数据
|
| | | * @param total 总记录数
|
| | | */
|
| | | public TableDataInfo(List<?> list, int total)
|
| | | public TableDataInfo(List<?> list, long total)
|
| | | {
|
| | | this.rows = list;
|
| | | this.total = total;
|
| | |
| | | |
| | | protected static final long MILLIS_MINUTE = 60 * MILLIS_SECOND; |
| | | |
| | | private final static long expireTime = CacheConstants.EXPIRATION; |
| | | private final static long TOKEN_EXPIRE_TIME = CacheConstants.EXPIRATION; |
| | | |
| | | private final static String ACCESS_TOKEN = CacheConstants.LOGIN_TOKEN_KEY; |
| | | |
| | | private final static Long MILLIS_MINUTE_TEN = CacheConstants.REFRESH_TIME * MILLIS_MINUTE; |
| | | private final static Long TOKEN_REFRESH_THRESHOLD_MINUTES = CacheConstants.REFRESH_TIME * MILLIS_MINUTE; |
| | | |
| | | /** |
| | | * 创建令牌 |
| | |
| | | // 接口返回信息 |
| | | Map<String, Object> rspMap = new HashMap<String, Object>(); |
| | | rspMap.put("access_token", JwtUtils.createToken(claimsMap)); |
| | | rspMap.put("expires_in", expireTime); |
| | | rspMap.put("expires_in", TOKEN_EXPIRE_TIME); |
| | | return rspMap; |
| | | } |
| | | |
| | |
| | | { |
| | | long expireTime = loginUser.getExpireTime(); |
| | | long currentTime = System.currentTimeMillis(); |
| | | if (expireTime - currentTime <= MILLIS_MINUTE_TEN) |
| | | if (expireTime - currentTime <= TOKEN_REFRESH_THRESHOLD_MINUTES) |
| | | { |
| | | refreshToken(loginUser); |
| | | } |
| | |
| | | public void refreshToken(LoginUser loginUser) |
| | | { |
| | | loginUser.setLoginTime(System.currentTimeMillis()); |
| | | loginUser.setExpireTime(loginUser.getLoginTime() + expireTime * MILLIS_MINUTE); |
| | | loginUser.setExpireTime(loginUser.getLoginTime() + TOKEN_EXPIRE_TIME * MILLIS_MINUTE); |
| | | // 根据uuid将loginUser缓存 |
| | | String userKey = getTokenKey(loginUser.getToken()); |
| | | redisService.setCacheObject(userKey, loginUser, expireTime, TimeUnit.MINUTES); |
| | | redisService.setCacheObject(userKey, loginUser, TOKEN_EXPIRE_TIME, TimeUnit.MINUTES); |
| | | } |
| | | |
| | | private String getTokenKey(String token) |
| | |
| | | int row = genTableMapper.updateGenTable(genTable);
|
| | | if (row > 0)
|
| | | {
|
| | | for (GenTableColumn cenTableColumn : genTable.getColumns())
|
| | | for (GenTableColumn genTableColumn : genTable.getColumns())
|
| | | {
|
| | | genTableColumnMapper.updateGenTableColumn(cenTableColumn);
|
| | | genTableColumnMapper.updateGenTableColumn(genTableColumn);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | throw new ServiceException("树名称字段不能为空");
|
| | | }
|
| | | }
|
| | | else if (GenConstants.TPL_SUB.equals(genTable.getTplCategory()))
|
| | | {
|
| | | if (StringUtils.isEmpty(genTable.getSubTableName()))
|
| | |
| | | else if (StringUtils.isEmpty(genTable.getSubTableFkName()))
|
| | | {
|
| | | throw new ServiceException("子表关联的外键名不能为空");
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | return $column.javaField;
|
| | | }
|
| | | #end
|
| | | #end
|
| | |
|
| | | #end
|
| | | #end
|
| | | #if($table.sub)
|
| | | public List<${subClassName}> get${subClassName}List()
|
| | | {
|
| | |
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['${moduleName}:${businessName}:add']"
|
| | | v-hasPermi="['${permissionPrefix}:add']"
|
| | | >新增</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | |
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['${moduleName}:${businessName}:edit']"
|
| | | v-hasPermi="['${permissionPrefix}:edit']"
|
| | | >修改</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-plus"
|
| | | @click="handleAdd(scope.row)"
|
| | | v-hasPermi="['${moduleName}:${businessName}:add']"
|
| | | v-hasPermi="['${permissionPrefix}:add']"
|
| | | >新增</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['${moduleName}:${businessName}:remove']"
|
| | | v-hasPermi="['${permissionPrefix}:remove']"
|
| | | >删除</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
| | | this.reset();
|
| | | this.getTreeselect();
|
| | | if (row != null) {
|
| | | this.form.${treeParentCode} = row.${treeCode};
|
| | | this.form.${treeParentCode} = row.${treeParentCode};
|
| | | }
|
| | | get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
| | | this.form = response.data;
|
| | |
| | | icon="el-icon-plus"
|
| | | size="mini"
|
| | | @click="handleAdd"
|
| | | v-hasPermi="['${moduleName}:${businessName}:add']"
|
| | | v-hasPermi="['${permissionPrefix}:add']"
|
| | | >新增</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | |
| | | size="mini"
|
| | | :disabled="single"
|
| | | @click="handleUpdate"
|
| | | v-hasPermi="['${moduleName}:${businessName}:edit']"
|
| | | v-hasPermi="['${permissionPrefix}:edit']"
|
| | | >修改</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | |
| | | size="mini"
|
| | | :disabled="multiple"
|
| | | @click="handleDelete"
|
| | | v-hasPermi="['${moduleName}:${businessName}:remove']"
|
| | | v-hasPermi="['${permissionPrefix}:remove']"
|
| | | >删除</el-button>
|
| | | </el-col>
|
| | | <el-col :span="1.5">
|
| | |
| | | icon="el-icon-download"
|
| | | size="mini"
|
| | | @click="handleExport"
|
| | | v-hasPermi="['${moduleName}:${businessName}:export']"
|
| | | v-hasPermi="['${permissionPrefix}:export']"
|
| | | >导出</el-button>
|
| | | </el-col>
|
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
| | |
| | | type="text"
|
| | | icon="el-icon-edit"
|
| | | @click="handleUpdate(scope.row)"
|
| | | v-hasPermi="['${moduleName}:${businessName}:edit']"
|
| | | v-hasPermi="['${permissionPrefix}:edit']"
|
| | | >修改</el-button>
|
| | | <el-button
|
| | | size="mini"
|
| | | type="text"
|
| | | icon="el-icon-delete"
|
| | | @click="handleDelete(scope.row)"
|
| | | v-hasPermi="['${moduleName}:${businessName}:remove']"
|
| | | v-hasPermi="['${permissionPrefix}:remove']"
|
| | | >删除</el-button>
|
| | | </template>
|
| | | </el-table-column>
|
| | |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['${moduleName}:${businessName}:add']" |
| | | v-hasPermi="['${permissionPrefix}:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | #end |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <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> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${permissionPrefix}:add']">新增</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | reset(); |
| | | await getTreeselect(); |
| | | if (row != null) { |
| | | form.value.${treeParentCode} = row.${treeCode}; |
| | | form.value.${treeParentCode} = row.${treeParentCode}; |
| | | } |
| | | get${BusinessName}(row.${pkColumn.javaField}).then(response => { |
| | | form.value = response.data; |
| | |
| | | plain |
| | | icon="Plus" |
| | | @click="handleAdd" |
| | | v-hasPermi="['${moduleName}:${businessName}:add']" |
| | | v-hasPermi="['${permissionPrefix}:add']" |
| | | >新增</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="Edit" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['${moduleName}:${businessName}:edit']" |
| | | v-hasPermi="['${permissionPrefix}:edit']" |
| | | >修改</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | icon="Delete" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['${moduleName}:${businessName}:remove']" |
| | | v-hasPermi="['${permissionPrefix}:remove']" |
| | | >删除</el-button> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | |
| | | plain |
| | | icon="Download" |
| | | @click="handleExport" |
| | | v-hasPermi="['${moduleName}:${businessName}:export']" |
| | | v-hasPermi="['${permissionPrefix}:export']" |
| | | >导出</el-button> |
| | | </el-col> |
| | | <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> |
| | |
| | | #end |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| | | <template #default="scope"> |
| | | <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> |
| | | <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${permissionPrefix}:edit']">修改</el-button> |
| | | <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${permissionPrefix}:remove']">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | /**
|
| | | * 获取路由名称,如没有配置路由名称则取路由地址
|
| | | *
|
| | | * @param routerName 路由名称
|
| | | * @param name 路由名称
|
| | | * @param path 路由地址
|
| | | * @return 路由名称(驼峰格式)
|
| | | */
|
| | |
| | | // 多角色设置permissions属性,以便数据权限匹配权限
|
| | | for (SysRole role : roles)
|
| | | {
|
| | | if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL))
|
| | | if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin())
|
| | | {
|
| | | Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId());
|
| | | role.setPermissions(rolePerms);
|
| | |
| | | insert into sys_user(
|
| | | <if test="userId != null and userId != 0">user_id,</if>
|
| | | <if test="deptId != null and deptId != 0">dept_id,</if>
|
| | | <if test="userName != null and userName != ''">user_name,</if>
|
| | | <if test="nickName != null and nickName != ''">nick_name,</if>
|
| | | <if test="email != null and email != ''">email,</if>
|
| | | <if test="avatar != null and avatar != ''">avatar,</if>
|
| | |
| | | position: relative;
|
| | | }
|
| | |
|
| | | .pagination-container {
|
| | | margin-top: 30px;
|
| | | }
|
| | |
|
| | | .text-center {
|
| | | text-align: center
|
| | | }
|
| | |
| | |
|
| | | /** 表格布局 **/
|
| | | .pagination-container {
|
| | | position: relative;
|
| | | height: 32px;
|
| | | margin-bottom: 10px;
|
| | | margin-top: 15px;
|
| | | padding: 10px 20px !important;
|
| | | display: flex;
|
| | | justify-content: flex-end;
|
| | | margin-top: 20px;
|
| | | }
|
| | |
|
| | | /* tree border */
|
| | |
| | | border: 1px solid #e5e6e7;
|
| | | background: #FFFFFF none;
|
| | | border-radius: 4px;
|
| | | }
|
| | |
|
| | | .pagination-container .el-pagination {
|
| | | right: 0;
|
| | | position: absolute;
|
| | | }
|
| | |
|
| | | @media (max-width: 768px) {
|
| | |
| | | }
|
| | |
|
| | | .card-box {
|
| | | padding-right: 15px;
|
| | | padding-left: 15px;
|
| | | margin-bottom: 10px;
|
| | | }
|
| | |
|
| | |
| | | <style scoped>
|
| | | .pagination-container {
|
| | | background: #fff;
|
| | | padding: 32px 16px;
|
| | | }
|
| | | .pagination-container.hidden {
|
| | | display: none;
|
| | |
| | | <div class="navbar">
|
| | | <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
|
| | |
|
| | | <breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
|
| | | <top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
|
| | | <breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container" />
|
| | | <top-nav v-if="topNav" id="topmenu-container" class="topmenu-container" />
|
| | |
|
| | | <div class="right-menu">
|
| | | <template v-if="device!=='mobile'">
|
| | |
| | |
|
| | | function filterChildren(childrenMap, lastRouter = false) {
|
| | | var children = []
|
| | | childrenMap.forEach((el, index) => {
|
| | | if (el.children && el.children.length) {
|
| | | if (el.component === 'ParentView' && !lastRouter) {
|
| | | el.children.forEach(c => {
|
| | | c.path = el.path + '/' + c.path
|
| | | if (c.children && c.children.length) {
|
| | | children = children.concat(filterChildren(c.children, c))
|
| | | return
|
| | | }
|
| | | children.push(c)
|
| | | })
|
| | | return
|
| | | }
|
| | | }
|
| | | if (lastRouter) {
|
| | | el.path = lastRouter.path + '/' + el.path
|
| | | if (el.children && el.children.length) {
|
| | | childrenMap.forEach(el => {
|
| | | el.path = lastRouter ? lastRouter.path + '/' + el.path : el.path
|
| | | if (el.children && el.children.length && el.component === 'ParentView') {
|
| | | children = children.concat(filterChildren(el.children, el))
|
| | | return
|
| | | } else {
|
| | | children.push(el)
|
| | | }
|
| | | }
|
| | | children = children.concat(el)
|
| | | })
|
| | | return children
|
| | | }
|
| | |
| | | |
| | | |
| | | /** |
| | | * 通用js方法封装处理 |
| | | * Copyright (c) 2019 ruoyi |
| | |
| | | }; |
| | | |
| | | var childrenListMap = {}; |
| | | var nodeIds = {}; |
| | | var tree = []; |
| | | |
| | | for (let d of data) { |
| | | let parentId = d[config.parentId]; |
| | | if (childrenListMap[parentId] == null) { |
| | | childrenListMap[parentId] = []; |
| | | } |
| | | nodeIds[d[config.id]] = d; |
| | | childrenListMap[parentId].push(d); |
| | | let id = d[config.id]; |
| | | childrenListMap[id] = d; |
| | | } |
| | | |
| | | for (let d of data) { |
| | | let parentId = d[config.parentId]; |
| | | if (nodeIds[parentId] == null) { |
| | | let parentId = d[config.parentId] |
| | | let parentObj = childrenListMap[parentId] |
| | | if (!parentObj) { |
| | | tree.push(d); |
| | | } |
| | | } |
| | | |
| | | for (let t of tree) { |
| | | adaptToChildrenList(t); |
| | | } |
| | | |
| | | function adaptToChildrenList(o) { |
| | | if (childrenListMap[o[config.id]] !== null) { |
| | | o[config.childrenList] = childrenListMap[o[config.id]]; |
| | | } |
| | | if (o[config.childrenList]) { |
| | | for (let c of o[config.childrenList]) { |
| | | adaptToChildrenList(c); |
| | | } |
| | | } else { |
| | | parentObj[config.childrenList].push(d) |
| | | } |
| | | } |
| | | return tree; |
| | |
| | | return result |
| | | } |
| | | |
| | | // 返回项目路径 |
| | | export function getNormalPath(p) { |
| | | if (p.length === 0 || !p || p == 'undefined') { |
| | | return p |
| | | }; |
| | | let res = p.replace('//', '/') |
| | | if (res[res.length - 1] === '/') { |
| | | return res.slice(0, res.length - 1) |
| | | } |
| | | return res |
| | | } |
| | | |
| | | // 验证是否为blob格式 |
| | | export function blobValidate(data) { |
| | | return data.type !== 'application/json' |
| | |
| | | <template>
|
| | | <div class="app-container home">
|
| | | <el-row :gutter="20">
|
| | | <el-col :sm="24" :lg="24">
|
| | | <blockquote class="text-warning" style="font-size: 14px">
|
| | | 阿里云服务器折扣区<el-link href="http://aly.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link> 腾讯云服务器秒杀区<el-link href="http://txy.ruoyi.vip" type="primary" target="_blank">☛☛点我进入☚☚</el-link>
|
| | | </blockquote>
|
| | | <hr />
|
| | | </el-col>
|
| | | </el-row>
|
| | | <el-row :gutter="20">
|
| | | <el-col :sm="24" :lg="12" style="padding-left: 20px">
|
| | | <h2>若依后台管理框架</h2>
|
| | | <p>
|
| | |
| | | // 日期范围
|
| | | dateRange: [],
|
| | | // 默认排序
|
| | | defaultSort: {prop: 'accessTime', order: 'descending'},
|
| | | defaultSort: { prop: "accessTime", order: "descending" },
|
| | | // 查询参数
|
| | | queryParams: {
|
| | | pageNum: 1,
|
| | |
| | | // 日期范围
|
| | | dateRange: [],
|
| | | // 默认排序
|
| | | defaultSort: {prop: 'operTime', order: 'descending'},
|
| | | defaultSort: { prop: "operTime", order: "descending" },
|
| | | // 表单参数
|
| | | form: {},
|
| | | // 查询参数
|