From a0c582e1ddcc97de36b6548279e89ac1b8446a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Mon, 29 Jan 2024 13:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=86=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/user-boot/user.ts | 33 +- src/components/table/header/index.vue | 6 +- src/components/tree/index.vue | 87 ++++-- .../admin/components/popup/password.vue | 2 +- src/styles/app.scss | 281 +++++++++--------- src/views/auth/userList/index.vue | 2 +- src/views/auth/userList/popupPwd.vue | 12 +- src/views/govern/manage/basic/dictionary.vue | 6 +- src/views/govern/manage/factory.vue | 2 +- src/views/user/login.vue | 91 +++--- src/views/user/popupUpdatePwd.vue | 95 ++++++ 11 files changed, 391 insertions(+), 226 deletions(-) create mode 100644 src/views/user/popupUpdatePwd.vue diff --git a/src/api/user-boot/user.ts b/src/api/user-boot/user.ts index 56968fa..a49a92c 100644 --- a/src/api/user-boot/user.ts +++ b/src/api/user-boot/user.ts @@ -2,14 +2,14 @@ import request from '@/utils/request' import { LoginData } from '@/api/types' import { useAdminInfo } from '@/stores/adminInfo' import { sm3Digest } from '@/assets/commjs/sm3.js' -import { sm2 } from '@/assets/commjs/sm2.js' +import { sm2, encrypt } from '@/assets/commjs/sm2.js' // 获取公钥 export function gongkey(params?: any) { if (!params) { const adminInfo = useAdminInfo() params = { - loginName: adminInfo.$state.loginName + loginName: encrypt(adminInfo.$state.loginName) } } return request({ @@ -19,8 +19,14 @@ export function gongkey(params?: any) { }) } -export async function pwdSm3(pwd: any) { - let publicKey = await gongkey() +export async function pwdSm3(pwd: any, loginName?: string) { + let publicKey = await gongkey( + loginName + ? { + loginName: encrypt(loginName) + } + : false + ) let sm3Pwd = sm3Digest(pwd) //SM3加密 return sm2(sm3Pwd + '|' + pwd, publicKey.data, 0) } @@ -64,7 +70,6 @@ export const getMarketList = () => { }) } - export function add(data: any) { return request({ url: '/user-boot/user/add', @@ -81,10 +86,10 @@ export function edit(data: any) { }) } -export async function passwordConfirm(pwd: string) { - +export async function passwordConfirm(pwd: string, loginName: string = '') { + console.log(pwd, loginName) return request({ - url: '/user-boot/user/passwordConfirm?password=' + await pwdSm3(pwd), + url: '/user-boot/user/passwordConfirm?password=' + (await pwdSm3(pwd, loginName)), method: 'get' }) } @@ -116,6 +121,16 @@ export async function updatePassword(params: any) { }) } +export async function updateFirstPassword(params: any) { + return request({ + url: '/user-boot/user/updateFirstPassword', + method: 'put', + data: { + name: params.name, + password: await pwdSm3(params.password, params.name) + } + }) +} export function checkUser(data: any) { return request({ @@ -123,4 +138,4 @@ export function checkUser(data: any) { method: 'put', data: data }) -} \ No newline at end of file +} diff --git a/src/components/table/header/index.vue b/src/components/table/header/index.vue index 1a9b172..c8e3774 100644 --- a/src/components/table/header/index.vue +++ b/src/components/table/header/index.vue @@ -13,7 +13,7 @@ label-position="left" :inline="true" class="table-com-search-form" - :label-width="90" + :label-width="labelWidth" > @@ -52,7 +52,7 @@ const tableHeader = ref() const datePickerRef = ref() const dictData = useDictData() const areaRef = ref() - +const labelWidth = ref('') interface Props { datePicker?: boolean area?: boolean @@ -103,9 +103,11 @@ const showSelectChange = () => { // 把dom(id=header-form)插入到table-com-search1或者table-com-search2 const dom = document.getElementById('header-form') as HTMLElement if (showSelect.value) { + labelWidth.value = '90' const dom1 = document.getElementById('table-com-search1') as HTMLElement dom1.appendChild(dom) } else { + labelWidth.value = '' const dom2 = document.getElementById('table-com-search2') as HTMLElement dom2.appendChild(dom) } diff --git a/src/components/tree/index.vue b/src/components/tree/index.vue index 6115652..a90f83a 100644 --- a/src/components/tree/index.vue +++ b/src/components/tree/index.vue @@ -1,37 +1,66 @@ +