This commit is contained in:
bwcx_jzy 2022-08-07 19:24:53 +08:00
parent d20b59c62e
commit cc9ed6fbb2
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
7 changed files with 95 additions and 27 deletions

View File

@ -1,3 +1,25 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Code Technology Studio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.jpom.controller.user;
import cn.hutool.core.collection.CollUtil;

View File

@ -1,3 +1,25 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Code Technology Studio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.jpom.model.user;
import io.jpom.model.BaseDbModel;

View File

@ -257,7 +257,7 @@ public class UserBindWorkspaceService extends BaseDbService<UserBindWorkspaceMod
.filter(Objects::nonNull)
.map(JSONArray::parseArray)
.filter(CollUtil::isNotEmpty)
.flatMap((Function<JSONArray, Stream<JSONObject>>) jsonArray -> jsonArray.stream().map(o -> (JSONObject) o))
.flatMap(jsonArray -> jsonArray.stream().map(o -> (JSONObject) o))
.collect(Collectors.toList());
if (CollUtil.isEmpty(allowExecuteListRule)) {
// 没有配置规则直接放行
@ -315,7 +315,7 @@ public class UserBindWorkspaceService extends BaseDbService<UserBindWorkspaceMod
.filter(Objects::nonNull)
.map(JSONArray::parseArray)
.filter(CollUtil::isNotEmpty)
.flatMap((Function<JSONArray, Stream<JSONObject>>) jsonArray -> jsonArray.stream().map(o -> (JSONObject) o))
.flatMap(jsonArray -> jsonArray.stream().map(o -> (JSONObject) o))
.filter(jsonObject -> {
String startTime = jsonObject.getString("startTime");
String endTime = jsonObject.getString("endTime");

View File

@ -1,3 +1,25 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2019 Code Technology Studio
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.jpom.service.user;
import io.jpom.model.user.UserPermissionGroupBean;

View File

@ -20,7 +20,6 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
import cn.hutool.core.lang.PatternPool;
import cn.hutool.core.util.CharsetUtil;
import cn.hutool.core.util.RandomUtil;

View File

@ -58,7 +58,7 @@
<a-modal v-model="editUserVisible" width="60vw" title="编辑用户" @ok="handleEditUserOk" :maskClosable="false">
<a-form-model ref="editUserForm" :rules="rules" :model="temp" :label-col="{ span: 4 }" :wrapper-col="{ span: 18 }">
<a-form-model-item label="登录名称" prop="id">
<a-input @change="checkTipUserName" :maxLength="50" v-model="temp.id" placeholder="登录名称,账号,邮箱,创建之后不能修改" :disabled="createOption == false" />
<a-input @change="checkTipUserName" :maxLength="50" v-model="temp.id" placeholder="登录名称,账号,创建之后不能修改" :disabled="createOption == false" />
</a-form-model-item>
<a-form-model-item label="昵称" prop="name">
@ -132,9 +132,6 @@ export default {
return {
loading: false,
list: [],
workspaceList: [],
targetKeys: [],
methodFeature: [],
temp: {},
createOption: true,
editUserVisible: false,

View File

@ -5,8 +5,7 @@
<a-table :data-source="list" size="middle" :columns="columns" :pagination="pagination" @change="changePage" bordered :rowKey="(record, index) => index">
<template slot="title">
<a-space>
<a-input v-model="listQuery.id" @pressEnter="loadData" placeholder="用户名ID" class="search-input-item" />
<a-input v-model="listQuery['%name%']" @pressEnter="loadData" placeholder="用户名" class="search-input-item" />
<a-input v-model="listQuery['%name%']" @pressEnter="loadData" placeholder="名称" class="search-input-item" />
<a-tooltip title="按住 Ctr 或者 Alt/Option 键点击按钮快速回到第一页">
<a-button type="primary" :loading="loading" @click="loadData">搜索</a-button>
</a-tooltip>
@ -19,20 +18,6 @@
<a-button type="danger" size="small" @click="handleDelete(record)">删除</a-button>
</a-space>
</template>
<template slot="systemUser" slot-scope="text, record">
<a-switch size="small" checked-children="" un-checked-children="" disabled :checked="record.systemUser == 1" />
</template>
<template slot="twoFactorAuthKey" slot-scope="text, record">
<a-switch size="small" checked-children="" un-checked-children="" disabled :checked="record.twoFactorAuthKey ? true : false" />
</template>
<a-tooltip slot="id" slot-scope="text" :title="text">
<span>{{ text }}</span>
</a-tooltip>
<a-tooltip slot="email" slot-scope="text" :title="text">
<span>{{ text }}</span>
</a-tooltip>
</a-table>
<!-- 编辑区 -->
<a-modal v-model="editVisible" destroyOnClose width="60vw" title="编辑" @ok="handleEditUserOk" :maskClosable="false">
@ -40,10 +25,24 @@
<a-form-model-item label="名称" prop="name">
<a-input v-model="temp.name" :maxLength="50" placeholder="名称" />
</a-form-model-item>
<a-form-model-item label="工作空间权限" prop="workspace">
<a-form-model-item prop="workspace">
<template slot="label">
工作空间
<a-tooltip v-if="!temp.id">
<template slot="title"> 配置工作空间权限,用户限制用户只能对应的工作空间里面操作对应的功能</template>
<a-icon type="question-circle" theme="filled" />
</a-tooltip>
</template>
<transfer ref="transferRef" :tree-data="workspaceList" :editKey="temp.targetKeys" />
</a-form-model-item>
<a-form-model-item label="禁用时段" prop="prohibitExecute">
<a-form-model-item prop="prohibitExecute">
<template slot="label">
禁用时段
<a-tooltip v-if="!temp.id">
<template slot="title"> 配置后可以控制想要在某个时间段禁止用户操作某些功能优先判断禁用时段</template>
<a-icon type="question-circle" theme="filled" />
</a-tooltip>
</template>
<div v-for="(item, index) in temp.prohibitExecuteArray" :key="item.key">
<div class="item-info">
<div>
@ -100,7 +99,14 @@
>添加</a-button
>
</a-form-model-item>
<a-form-model-item label="允许时段" prop="allowExecute">
<a-form-model-item prop="allowExecute">
<template slot="label">
允许时段
<a-tooltip v-if="!temp.id">
<template slot="title"> 优先判断禁用时段,再判断允许时段配置允许时段后用户只能在对应的时段执行相应功能的操作</template>
<a-icon type="question-circle" theme="filled" />
</a-tooltip>
</template>
<div v-for="(item, index) in temp.allowExecuteArray" :key="item.key">
<div class="item-info">
<div>
@ -176,7 +182,7 @@ export default {
loading: false,
list: [],
workspaceList: [],
targetKeys: [],
methodFeature: [],
temp: {},
weeks: [