feat:全局人脸
This commit is contained in:
1 parent
bac2067c08
commit
97036f0f68
3 files changed
+123
-98
No files matched your search
+61
-60
@@ -1,94 +1,95 @@
|
||||
import request from '/@/utils/request';
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export const list = () => {
|
||||
return request({
|
||||
url: '/admin/user/list',
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
url: "/admin/user/list",
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export const pageList = (params?: Object) => {
|
||||
return request({
|
||||
url: '/admin/user/page',
|
||||
method: 'get',
|
||||
url: "/admin/user/page",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const addObj = (obj: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'post',
|
||||
url: "/admin/user",
|
||||
method: "post",
|
||||
data: obj,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const getObj = (id: String) => {
|
||||
return request({
|
||||
url: '/admin/user/details/' + id,
|
||||
method: 'get',
|
||||
});
|
||||
};
|
||||
url: "/admin/user/details/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export const delObj = (ids: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'delete',
|
||||
url: "/admin/user",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const putObj = (obj: Object) => {
|
||||
return request({
|
||||
url: '/admin/user',
|
||||
method: 'put',
|
||||
url: "/admin/user",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export function getDetails(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/details',
|
||||
method: 'get',
|
||||
url: "/admin/user/details",
|
||||
method: "get",
|
||||
params: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 更改个人信息
|
||||
export function editInfo(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/personal/edit',
|
||||
method: 'put',
|
||||
url: "/admin/user/personal/edit",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
// 更改个人密码
|
||||
export function password(obj: Object) {
|
||||
return request({
|
||||
url: '/admin/user/personal/password',
|
||||
method: 'put',
|
||||
url: "/admin/user/personal/password",
|
||||
method: "put",
|
||||
data: obj,
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function unbindingUser(type) {
|
||||
return request({
|
||||
url: '/admin/user/unbinding',
|
||||
method: 'post',
|
||||
url: "/admin/user/unbinding",
|
||||
method: "post",
|
||||
params: {
|
||||
type,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function checkPassword(password: string) {
|
||||
return request({
|
||||
url: '/admin/user/check',
|
||||
method: 'post',
|
||||
url: "/admin/user/check",
|
||||
method: "post",
|
||||
params: {
|
||||
password,
|
||||
},
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -96,50 +97,50 @@ export function checkPassword(password: string) {
|
||||
*/
|
||||
export const registerUser = (userInfo: object) => {
|
||||
return request({
|
||||
url: '/admin/register/user',
|
||||
method: 'post',
|
||||
url: "/admin/register/user",
|
||||
method: "post",
|
||||
data: userInfo,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export const resetUserPassword = (userInfo: object) => {
|
||||
return request({
|
||||
url: '/admin/register/password',
|
||||
method: 'post',
|
||||
url: "/admin/register/password",
|
||||
method: "post",
|
||||
data: userInfo,
|
||||
});
|
||||
};
|
||||
})
|
||||
}
|
||||
|
||||
export function validateUsername(rule: any, value: any, callback: any, isEdit: boolean) {
|
||||
const flag = new RegExp(/^([a-z\d]+?)$/).test(value);
|
||||
const flag = new RegExp(/^([a-z\d]+?)$/).test(value)
|
||||
if (!flag) {
|
||||
callback(new Error('用户名支持小写英文、数字'));
|
||||
callback(new Error("用户名支持小写英文、数字"))
|
||||
}
|
||||
|
||||
if (isEdit) {
|
||||
return callback();
|
||||
return callback()
|
||||
}
|
||||
|
||||
getDetails({ username: value }).then((response) => {
|
||||
const result = response.data;
|
||||
const result = response.data
|
||||
if (result !== null) {
|
||||
callback(new Error('用户名已经存在'));
|
||||
callback(new Error("用户名已经存在"))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
export function validatePhone(rule: any, value: any, callback: any, isEdit: boolean) {
|
||||
if (isEdit) {
|
||||
return callback();
|
||||
return callback()
|
||||
}
|
||||
getDetails({ phone: value }).then((response) => {
|
||||
const result = response.data;
|
||||
const result = response.data
|
||||
if (result !== null) {
|
||||
callback(new Error('手机号已经存在'));
|
||||
callback(new Error("手机号已经存在"))
|
||||
} else {
|
||||
callback();
|
||||
callback()
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
+37
-30
@@ -1,49 +1,56 @@
|
||||
import request from "/@/utils/request"
|
||||
|
||||
export const putGlobalFace = (obj: Object) => {
|
||||
return request({
|
||||
url: "/admin/user-face/global-face",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face/page-join',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'post',
|
||||
data: obj
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: '/admin/user-face/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
}
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: '/admin/user-face',
|
||||
method: 'put',
|
||||
data: obj
|
||||
})
|
||||
return request({
|
||||
url: "/admin/user-face",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -113,11 +113,6 @@
|
||||
<el-tag v-for="(item, index) in scope.row.roleList" :key="index">{{ item.roleName }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80" label="人脸">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.faceImgs" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('sysuser.lockFlag')" show-overflow-tooltip>
|
||||
<template #default="scope">
|
||||
<el-switch
|
||||
@@ -128,6 +123,22 @@
|
||||
></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="80" label="人脸">
|
||||
<template #default="{ row }">
|
||||
<preview-image :src="row.faceImgs" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="全局人脸" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<el-switch
|
||||
v-if="row.isGlobalFace"
|
||||
v-model="row.isGlobalFace"
|
||||
@change="changeGlobalFaceSwitch(row)"
|
||||
active-value="1"
|
||||
inactive-value="0"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('common.action')" width="300" fixed="right">
|
||||
<template #default="scope">
|
||||
<div style="display: flex">
|
||||
@@ -180,11 +191,8 @@
|
||||
</div>
|
||||
</pane>
|
||||
</splitpanes>
|
||||
|
||||
<user-form ref="userDialogRef" @refresh="getDataList(false)" :deptId="state.queryForm.deptId" />
|
||||
|
||||
<face-manage ref="faceManageRef" @refresh="getDataList(false)" />
|
||||
|
||||
<upload-excel
|
||||
ref="excelUploadRef"
|
||||
:title="$t('sysuser.importUserTip')"
|
||||
@@ -197,6 +205,7 @@
|
||||
|
||||
<script lang="ts" name="systemUser" setup>
|
||||
import { delObj, pageList, putObj } from "/@/api/admin/user"
|
||||
import { putGlobalFace } from "/@/api/admin/userFace"
|
||||
import { deptTree } from "/@/api/admin/dept"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
@@ -299,6 +308,14 @@ const changeSwitch = async (row: any) => {
|
||||
getDataList()
|
||||
}
|
||||
|
||||
const changeGlobalFaceSwitch = async (row: any) => {
|
||||
if (!row.isGlobalFace) return
|
||||
// 不修改密码
|
||||
await putGlobalFace({ userId: row.userId, isGlobalFace: row.isGlobalFace })
|
||||
useMessage().success(t("common.optSuccessText"))
|
||||
getDataList()
|
||||
}
|
||||
|
||||
//修改用户密码
|
||||
const changePassword = async (row: any) => {
|
||||
if (!inputPassword.value || inputPassword.value.length < 6 || inputPassword.value.length > 20) {
|
||||
|
||||
Reference in new issue
Block a user