解决非admin用户的一些操作权限问题

This commit is contained in:
luckyxz
2022-06-28 14:49:24 +08:00
parent a4cec682a7
commit 6db67e0195
8 changed files with 49 additions and 6 deletions

View File

@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.system;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.secure.BCrypt;
import cn.hutool.core.bean.BeanUtil;
@@ -64,6 +65,18 @@ public class SysUserController extends BaseController {
return userService.selectPageUserList(user, pageQuery);
}
/**
* 查询用户列表,用于用户选择场景
*/
@ApiOperation("查询用户列表")
@SaCheckLogin
@GetMapping("/selectUser")
public TableDataInfo<SysUser> selectUser(SysUser user, PageQuery pageQuery) {
return userService.selectPageUserList(user, pageQuery);
}
@ApiOperation("导出用户列表")
@Log(title = "用户管理", businessType = BusinessType.EXPORT)
@SaCheckPermission("system:user:export")

View File

@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.workflow;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
@@ -53,6 +54,16 @@ public class WfCategoryController extends BaseController {
return flowCategoryService.queryPageList(bo, pageQuery);
}
/**
* 查询全部的流程分类列表
*/
@ApiOperation("查询全部流程分类列表")
@SaCheckLogin
@GetMapping("/listAll")
public R<List<WfCategoryVo>> listAll(@Validated(QueryGroup.class) WfCategoryBo bo) {
return R.ok(flowCategoryService.queryList(bo));
}
/**
* 导出流程分类列表
*/

View File

@@ -1,5 +1,6 @@
package com.ruoyi.web.controller.workflow;
import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
@@ -79,7 +80,7 @@ public class WfDefinitionController extends BaseController {
@ApiOperation(value = "读取xml文件")
@SaCheckPermission("workflow:definition:view")
@SaCheckLogin
@GetMapping("/readXml/{definitionId}")
public R<String> readXml(@ApiParam(value = "流程定义ID") @PathVariable(value = "definitionId") String definitionId) {
try {

View File

@@ -10,6 +10,15 @@ export function listUser(query) {
})
}
// 查询用户列表,用于流程里的用户选择
export function selectUser(query) {
return request({
url: '/system/user/selectUser',
method: 'get',
params: query
})
}
// 查询用户详细
export function getUser(userId) {
return request({

View File

@@ -9,6 +9,15 @@ export function listCategory(query) {
})
}
// 查询流程分类列表
export function listAllCategory(query) {
return request({
url: '/workflow/category/listAll',
method: 'get',
params: query
})
}
// 查询流程分类详细
export function getCategory(categoryId) {
return request({

View File

@@ -189,7 +189,7 @@ import { treeselect } from '@/api/system/dept'
import ProcessViewer from '@/components/ProcessViewer'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import Treeselect from '@riophae/vue-treeselect'
import { listUser } from '@/api/system/user'
import { selectUser } from '@/api/system/user'
export default {
name: "Detail",
@@ -330,7 +330,7 @@ export default {
/** 查询用户列表 */
getList() {
this.userLoading = true;
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
selectUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
this.userList = response.rows;
this.total = response.total;
this.toggleSelection(this.userMultipleSelection);

View File

@@ -56,7 +56,7 @@
size="mini"
icon="el-icon-video-play"
@click="handleStart(scope.row)"
v-hasPermi="['workflow:definition:designer']"
v-hasPermi="['workflow:process:start']"
>发起</el-button>
</template>
</el-table-column>

View File

@@ -107,7 +107,7 @@
<script>
import { listOwnProcess, stopProcess, delProcess } from '@/api/workflow/process';
import { listCategory } from '@/api/workflow/category';
import { listAllCategory } from '@/api/workflow/category';
export default {
name: "Own",
components: {
@@ -165,7 +165,7 @@ export default {
methods: {
/** 查询流程分类列表 */
getCategoryList() {
listCategory().then(response => this.categoryOptions = response.rows)
listAllCategory().then(response => this.categoryOptions = response.rows)
},
/** 查询流程定义列表 */
getList() {