🦺 修改权限页面(添加method和url字段)
This commit is contained in:
parent
c23e55c819
commit
44732e6352
|
@ -1,7 +1,7 @@
|
||||||
package com.spring.step2.config;
|
package com.spring.step2.config;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
import com.spring.step2.context.BaseContext;
|
import com.spring.step2.config.context.BaseContext;
|
||||||
import org.apache.ibatis.reflection.MetaObject;
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.spring.step2.context;
|
package com.spring.step2.config.context;
|
||||||
|
|
||||||
|
|
||||||
public class BaseContext {
|
public class BaseContext {
|
|
@ -1,6 +1,6 @@
|
||||||
package com.spring.step2.config.web;
|
package com.spring.step2.config.web;
|
||||||
|
|
||||||
import com.spring.step2.context.BaseContext;
|
import com.spring.step2.config.context.BaseContext;
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
|
@ -27,7 +27,7 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
@Tag(name = "系统权限表", description = "系统权限表相关接口")
|
@Tag(name = "系统权限表", description = "系统权限表相关接口")
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/api/permission")
|
@RequestMapping(value = "/api/permission", method = RequestMethod.DELETE)
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class PermissionController {
|
public class PermissionController {
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,12 @@ public class PermissionDto {
|
||||||
@Schema(name = "permissionCode", title = "权限编码")
|
@Schema(name = "permissionCode", title = "权限编码")
|
||||||
private String permissionCode;
|
private String permissionCode;
|
||||||
|
|
||||||
|
@Schema(name = "url", description = "URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(name = "method", description = "请求方法类型")
|
||||||
|
private String method;
|
||||||
|
|
||||||
@Schema(name = "description", title = "权限描述")
|
@Schema(name = "description", title = "权限描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,12 @@ public class PermissionEntity extends BaseEntity {
|
||||||
@Schema(name = "permissionCode", title = "权限编码")
|
@Schema(name = "permissionCode", title = "权限编码")
|
||||||
private String permissionCode;
|
private String permissionCode;
|
||||||
|
|
||||||
|
@Schema(name = "url", description = "URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(name = "method", description = "请求方法类型")
|
||||||
|
private String method;
|
||||||
|
|
||||||
@Schema(name = "description", title = "权限描述")
|
@Schema(name = "description", title = "权限描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,12 @@ public class PermissionVo extends BaseVo {
|
||||||
@Schema(name = "permissionCode", title = "权限编码")
|
@Schema(name = "permissionCode", title = "权限编码")
|
||||||
private String permissionCode;
|
private String permissionCode;
|
||||||
|
|
||||||
|
@Schema(name = "url", description = "URL")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@Schema(name = "method", description = "请求方法类型")
|
||||||
|
private String method;
|
||||||
|
|
||||||
@Schema(name = "description", title = "权限描述")
|
@Schema(name = "description", title = "权限描述")
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
<resultMap id="BaseResultMap" type="com.spring.step2.domain.entity.PermissionEntity">
|
<resultMap id="BaseResultMap" type="com.spring.step2.domain.entity.PermissionEntity">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<id column="permission_code" property="permissionCode"/>
|
<id column="permission_code" property="permissionCode"/>
|
||||||
|
<id column="url" property="url"/>
|
||||||
|
<id column="method" property="method"/>
|
||||||
<id column="description" property="description"/>
|
<id column="description" property="description"/>
|
||||||
<id column="remark" property="remark"/>
|
<id column="remark" property="remark"/>
|
||||||
<id column="create_time" property="createTime"/>
|
<id column="create_time" property="createTime"/>
|
||||||
|
@ -17,7 +19,7 @@
|
||||||
|
|
||||||
<!-- 通用查询结果列 -->
|
<!-- 通用查询结果列 -->
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,permission_code,description,remark,create_time,update_time,create_user,update_user,is_deleted
|
id,permission_code,url,method,description,remark,create_time,update_time,create_user,update_user,is_deleted
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询系统权限表内容 -->
|
<!-- 分页查询系统权限表内容 -->
|
||||||
|
@ -30,6 +32,12 @@
|
||||||
<if test="dto.permissionCode != null and dto.permissionCode != ''">
|
<if test="dto.permissionCode != null and dto.permissionCode != ''">
|
||||||
and permission_code like CONCAT('%',#{dto.permissionCode},'%')
|
and permission_code like CONCAT('%',#{dto.permissionCode},'%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="dto.url != null and dto.url != ''">
|
||||||
|
and url like CONCAT('%',#{dto.url},'%')
|
||||||
|
</if>
|
||||||
|
<if test="dto.method != null and dto.method != ''">
|
||||||
|
and method like CONCAT('%',#{dto.method},'%')
|
||||||
|
</if>
|
||||||
<if test="dto.description != null and dto.description != ''">
|
<if test="dto.description != null and dto.description != ''">
|
||||||
and description like CONCAT('%',#{dto.description},'%')
|
and description like CONCAT('%',#{dto.description},'%')
|
||||||
</if>
|
</if>
|
||||||
|
|
|
@ -16,11 +16,25 @@ const DialogPermission = defineComponent({
|
||||||
<!-- 内容 -->
|
<!-- 内容 -->
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label" for="dialogPermissionCode"><i class="fas fa-user-alt me-1"></i>权限码</label>
|
<label class="form-label" for="dialogPermissionCode"><i
|
||||||
|
class="fas fa-user-alt me-1"></i>权限码</label>
|
||||||
<input autocomplete="false" class="form-control" id="dialogPermissionCode" placeholder="请输入权限码"
|
<input autocomplete="false" class="form-control" id="dialogPermissionCode" placeholder="请输入权限码"
|
||||||
type="text" v-model="form.permissionCode" required>
|
type="text" v-model="form.permissionCode" required>
|
||||||
<div class="form-text">在这里输入你的权限码。</div>
|
<div class="form-text">在这里输入你的权限码。</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label" for="url"><i class="fas fa-ruler me-1"></i>URL</label>
|
||||||
|
<input autocomplete="false" class="form-control" id="url" placeholder="请输入URL" type="text"
|
||||||
|
v-model="form.url">
|
||||||
|
</div>
|
||||||
|
<div class="mb-3">
|
||||||
|
<label class="form-label" for="method"><i class="fas fa-pager me-1"></i>请求方法名称</label>
|
||||||
|
<select class="form-select" aria-label="Default select example" v-model="form.method">
|
||||||
|
<option v-for="method in requestMethod" :key="method">
|
||||||
|
{{method}}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label class="form-label" for="dialogDescription"><i class="fas fa-user-alt me-1"></i>描述</label>
|
<label class="form-label" for="dialogDescription"><i class="fas fa-user-alt me-1"></i>描述</label>
|
||||||
<input autocomplete="false" class="form-control" id="dialogDescription" placeholder="请输入描述"
|
<input autocomplete="false" class="form-control" id="dialogDescription" placeholder="请输入描述"
|
||||||
|
@ -57,6 +71,7 @@ const DialogPermission = defineComponent({
|
||||||
return {
|
return {
|
||||||
modalInstance: ref(null),
|
modalInstance: ref(null),
|
||||||
form: ref({}),
|
form: ref({}),
|
||||||
|
requestMethod: ref(["", "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "TRACE"])
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -51,6 +51,18 @@
|
||||||
<input autocomplete="false" class="form-control" id="permissionCode" placeholder="请输入权限码"
|
<input autocomplete="false" class="form-control" id="permissionCode" placeholder="请输入权限码"
|
||||||
type="text" v-model="searchForm.permissionCode">
|
type="text" v-model="searchForm.permissionCode">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label" for="url"><i
|
||||||
|
class="fas fa-ruler me-1"></i>URL</label>
|
||||||
|
<input autocomplete="false" class="form-control" id="url" placeholder="请输入URL"
|
||||||
|
type="text" v-model="searchForm.url">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label class="form-label" for="method"><i
|
||||||
|
class="fas fa-pager me-1"></i>请求方法名称</label>
|
||||||
|
<input autocomplete="false" class="form-control" id="method" placeholder="请输入请求方法名称"
|
||||||
|
type="text" v-model="searchForm.method">
|
||||||
|
</div>
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
<label class="form-label" for="description"><i class="fas fa-text-width me-1"></i>描述</label>
|
<label class="form-label" for="description"><i class="fas fa-text-width me-1"></i>描述</label>
|
||||||
<input autocomplete="false" class="form-control" id="description" placeholder="请输入描述"
|
<input autocomplete="false" class="form-control" id="description" placeholder="请输入描述"
|
||||||
|
@ -91,9 +103,11 @@
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" width="5%">#</th>
|
<th scope="col" width="5%">#</th>
|
||||||
<th scope="col" width="15%">权限名</th>
|
<th scope="col" width="10%">权限名</th>
|
||||||
<th scope="col" width="15%">描述</th>
|
<th scope="col" width="10%">描述</th>
|
||||||
<th scope="col" width="15%">简述</th>
|
<th scope="col" width="10%">简述</th>
|
||||||
|
<th scope="col" width="10%">地址</th>
|
||||||
|
<th scope="col" width="5%">方法</th>
|
||||||
<th scope="col" width="15%">创建时间</th>
|
<th scope="col" width="15%">创建时间</th>
|
||||||
<th scope="col" width="15%">更新时间</th>
|
<th scope="col" width="15%">更新时间</th>
|
||||||
<th scope="col" width="20%">操作</th>
|
<th scope="col" width="20%">操作</th>
|
||||||
|
@ -105,6 +119,8 @@
|
||||||
<td>{{permission.permissionCode}}</td>
|
<td>{{permission.permissionCode}}</td>
|
||||||
<td>{{permission.description}}</td>
|
<td>{{permission.description}}</td>
|
||||||
<td>{{permission.remark}}</td>
|
<td>{{permission.remark}}</td>
|
||||||
|
<td>{{permission.url}}</td>
|
||||||
|
<td>{{permission.method}}</td>
|
||||||
<td>{{formatDate(permission.createTime)}}</td>
|
<td>{{formatDate(permission.createTime)}}</td>
|
||||||
<td>{{formatDate(permission.updateTime)}}</td>
|
<td>{{formatDate(permission.updateTime)}}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -149,7 +165,10 @@
|
||||||
// 查询表单
|
// 查询表单
|
||||||
searchForm: ref({
|
searchForm: ref({
|
||||||
permissionCode: undefined,
|
permissionCode: undefined,
|
||||||
email: undefined,
|
url: undefined,
|
||||||
|
method: undefined,
|
||||||
|
description: undefined,
|
||||||
|
remark: undefined,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 30,
|
pageSize: 30,
|
||||||
pages: 0
|
pages: 0
|
||||||
|
@ -187,7 +206,10 @@
|
||||||
/* 重制表单 */
|
/* 重制表单 */
|
||||||
onRest() {
|
onRest() {
|
||||||
this.searchForm.permissionCode = undefined;
|
this.searchForm.permissionCode = undefined;
|
||||||
this.searchForm.email = undefined;
|
this.searchForm.url = undefined;
|
||||||
|
this.searchForm.method = undefined;
|
||||||
|
this.searchForm.description = undefined;
|
||||||
|
this.searchForm.remark = undefined;
|
||||||
this.onSearch();
|
this.onSearch();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -88,11 +88,11 @@
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" width="5%">#</th>
|
<th scope="col" width="5%">#</th>
|
||||||
<th scope="col" width="22%">用户名</th>
|
<th scope="col" width="20%">用户名</th>
|
||||||
<th scope="col" width="22%">邮箱</th>
|
<th scope="col" width="20%">邮箱</th>
|
||||||
<th scope="col" width="17%">创建时间</th>
|
<th scope="col" width="17%">创建时间</th>
|
||||||
<th scope="col" width="17%">更新时间</th>
|
<th scope="col" width="17%">更新时间</th>
|
||||||
<th scope="col" width="16%">操作</th>
|
<th scope="col" width="20%">操作</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
Loading…
Reference in New Issue