Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Y
yishuju-ui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
何远江
yishuju-ui
Commits
28075edd
Commit
28075edd
authored
Mar 20, 2025
by
沈翠玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账号管理-重置密码和修改密码
parent
53d70e1e
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
132 additions
and
49 deletions
+132
-49
PasswordDialog.vue
src/layouts/components/Header/components/PasswordDialog.vue
+32
-2
AccountFormModal.vue
...iews/system/accountManage/components/AccountFormModal.vue
+0
-8
index.vue
src/views/system/accountManage/index.vue
+29
-4
AccountFormModal.vue
.../system/legalMemberManage/components/AccountFormModal.vue
+6
-12
index.vue
src/views/system/legalMemberManage/index.vue
+28
-4
AccountFormModal.vue
...s/system/riskMemberManage/components/AccountFormModal.vue
+6
-12
index.vue
src/views/system/riskMemberManage/index.vue
+28
-4
vite.config.js
vite.config.js
+3
-3
No files found.
src/layouts/components/Header/components/PasswordDialog.vue
View file @
28075edd
<
template
>
<el-dialog
v-model=
"dialogVisible"
title=
"修改密码"
width=
"500px"
draggable
>
<span>
This is Password
</span>
<span>
新密码:
<el-input
v-model=
"form.password"
placeholder=
"请输入新密码"
/>
</span>
<template
#
footer
>
<span
class=
"dialog-footer"
>
<el-button
@
click=
"dialogVisible = false"
>
取消
</el-button>
<el-button
type=
"primary"
@
click=
"
dialogVisible = false
"
>
确认
</el-button>
<el-button
type=
"primary"
@
click=
"
submitForm
"
>
确认
</el-button>
</span>
</
template
>
</el-dialog>
...
...
@@ -12,11 +12,41 @@
<
script
setup
>
import
{
ref
}
from
'vue'
;
import
{
editPassword
}
from
'@/api/user'
;
import
{
ElMessage
}
from
'element-plus'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useUserStore
}
from
'@/stores/modules/user'
;
const
{
userInfo
}
=
useUserStore
();
const
userStore
=
useUserStore
();
import
{
LOGIN_URL
}
from
'@/config'
;
const
router
=
useRouter
();
const
form
=
ref
({
password
:
''
});
const
dialogVisible
=
ref
(
false
);
const
openDialog
=
()
=>
{
dialogVisible
.
value
=
true
;
};
const
submitForm
=
async
()
=>
{
editPassword
({
id
:
userInfo
.
id
,
password
:
form
.
value
.
password
}).
then
(
async
res
=>
{
if
(
res
.
success
)
{
ElMessage
({
type
:
'success'
,
message
:
'修改密码成功!'
,
plain
:
true
,
});
dialogVisible
.
value
=
false
await
userStore
.
logout
();
// 重定向到登陆页
router
.
replace
(
LOGIN_URL
);
}
})
}
defineExpose
({
openDialog
});
</
script
>
src/views/system/accountManage/components/AccountFormModal.vue
View file @
28075edd
...
...
@@ -15,11 +15,6 @@
<el-input
v-model=
"form.phone"
placeholder=
"请输入手机号"
clearable
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form.password"
placeholder=
"请输入密码"
clearable
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"用户名称"
prop=
"username"
>
<el-input
v-model=
"form.username"
placeholder=
"请输入用户名称"
clearable
/>
...
...
@@ -99,7 +94,6 @@
const
form
=
ref
({
username
:
''
,
roles
:
[],
password
:
''
,
phone
:
''
,
departmentId
:
null
,
tenant
:
null
,
...
...
@@ -120,7 +114,6 @@
};
const
rules
=
ref
({
username
:
{
required
:
true
,
message
:
'请输入用户名称'
,
trigger
:
'blur'
},
password
:
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
phone
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validatePhone
,
trigger
:
'blur'
},
...
...
@@ -164,7 +157,6 @@
form
.
value
=
{
username
:
''
,
roles
:
[],
password
:
''
,
phone
:
''
,
departmentId
:
null
,
tenant
:
null
,
...
...
src/views/system/accountManage/index.vue
View file @
28075edd
...
...
@@ -25,7 +25,7 @@
import
{
Delete
,
Edit
,
Plus
}
from
'@element-plus/icons-vue'
;
import
{
reactive
,
ref
}
from
'vue'
;
import
{
ElButton
,
ElMessageBox
,
ElMessage
,
ElTag
}
from
'element-plus'
;
import
{
getUserPage
,
s
aveUser
,
deleteUsers
}
from
'@/api/user'
;
import
{
getUserPage
,
s
etStatus
,
deleteUsers
,
restPassword
}
from
'@/api/user'
;
import
{
useDict
}
from
'@/hooks/useDict'
;
import
{
onMounted
}
from
'vue'
;
import
{
getTenantPage
}
from
'@/api/tenant'
;
...
...
@@ -53,6 +53,7 @@ import { getdepartmentTree } from '@/api/departmentManage';
},
field
:
'tenantNames'
,
enum
:
Tenantlist
,
width
:
120
,
search
:
{
el
:
'select'
,
props
:
{
filterable
:
true
},
key
:
'tenant'
,
labelWidth
:
85
},
fieldNames
:
{
label
:
'name'
,
value
:
'id'
},
title
:
'调解中心'
...
...
@@ -66,6 +67,7 @@ import { getdepartmentTree } from '@/api/departmentManage';
);
},
},
width
:
120
,
field
:
'role'
,
enum
:
Rolelist
,
search
:
{
el
:
'select'
,
props
:
{
filterable
:
true
},
key
:
'roleCode'
,
labelWidth
:
85
},
...
...
@@ -116,7 +118,7 @@ import { getdepartmentTree } from '@/api/departmentManage';
{
field
:
'action'
,
title
:
'操作'
,
width
:
2
0
0
,
width
:
2
6
0
,
fixed
:
'right'
,
slots
:
{
default
:
({
row
})
=>
{
...
...
@@ -128,6 +130,9 @@ import { getdepartmentTree } from '@/api/departmentManage';
<
ElButton
link
type
=
"primary"
icon
=
{
Edit
}
onClick
=
{()
=>
handleDisable
(
row
)}
>
{
row
.
status
==
'enable'
?
'禁用'
:
'启用'
}
<
/ElButton
>
<
ElButton
link
type
=
"primary"
onClick
=
{()
=>
handleRefresh
(
row
)}
>
重置密码
<
/ElButton
>
<
/
>
);
},
...
...
@@ -135,7 +140,27 @@ import { getdepartmentTree } from '@/api/departmentManage';
},
],
});
const
handleRefresh
=
async
(
row
)
=>
{
await
ElMessageBox
.
confirm
(
`是否确认重置该用户的密码?`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
);
// 修改的状态
await
restPassword
({
id
:
row
.
id
});
ElMessage
({
type
:
'success'
,
message
:
`重置成功!`
,
plain
:
true
,
});
}
const
handleDelete
=
async
()
=>
{
const
list
=
proTable
.
value
.
element
.
getCheckboxRecords
();
if
(
list
.
length
)
{
...
...
@@ -170,8 +195,8 @@ import { getdepartmentTree } from '@/api/departmentManage';
// 修改的状态
const
status
=
row
.
status
===
'enable'
?
'disable'
:
'enable'
;
await
s
aveUser
({
...
row
,
await
s
etStatus
({
id
:
row
.
id
,
status
,
});
...
...
src/views/system/legalMemberManage/components/AccountFormModal.vue
View file @
28075edd
...
...
@@ -15,11 +15,6 @@
<el-input
v-model=
"form.phone"
placeholder=
"请输入手机号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form.password"
placeholder=
"请输入密码"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"用户名称"
prop=
"username"
>
<el-input
v-model=
"form.username"
placeholder=
"请输入用户名称"
/>
...
...
@@ -46,7 +41,7 @@
<
script
setup
>
import
{
computed
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
saveLeaderGroup
}
from
'@/api/user'
;
import
{
saveLeaderGroup
,
saveUser
}
from
'@/api/user'
;
import
{
getDefualtRoles
}
from
'@/api/role'
;
import
{
ElMessage
}
from
'element-plus'
;
...
...
@@ -56,7 +51,6 @@
const
loading
=
ref
(
false
);
const
form
=
ref
({
username
:
''
,
password
:
''
,
phone
:
''
,
status
:
'enable'
,
});
...
...
@@ -73,7 +67,6 @@
};
const
rules
=
ref
({
username
:
{
required
:
true
,
message
:
'请输入用户名称'
,
trigger
:
'blur'
},
password
:
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
phone
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validatePhone
,
trigger
:
'blur'
},
...
...
@@ -88,9 +81,11 @@
try
{
await
formRef
.
value
.
validate
();
loading
.
value
=
true
;
if
(
isEdit
.
value
)
{
await
saveUser
(
form
.
value
)
}
else
{
await
saveLeaderGroup
({...
form
.
value
,
role
:
'legal_affairs_commissioner'
});
}
ElMessage
({
type
:
'success'
,
message
:
isEdit
.
value
?
'修改成功!'
:
'添加成功!'
,
...
...
@@ -106,7 +101,6 @@
form
.
value
=
{
username
:
''
,
roles
:
[],
password
:
''
,
phone
:
''
,
status
:
'enable'
,
};
...
...
src/views/system/legalMemberManage/index.vue
View file @
28075edd
...
...
@@ -25,7 +25,7 @@
import
{
Delete
,
Edit
,
Plus
}
from
'@element-plus/icons-vue'
;
import
{
reactive
,
ref
}
from
'vue'
;
import
{
ElButton
,
ElMessageBox
,
ElMessage
,
ElTag
}
from
'element-plus'
;
import
{
getleaderGroupPage
,
s
aveLeaderGroup
,
batchDeleteByIds
}
from
'@/api/user'
;
import
{
getleaderGroupPage
,
s
etStatus
,
batchDeleteByIds
,
restPassword
}
from
'@/api/user'
;
import
{
useDict
}
from
'@/hooks/useDict'
;
import
{
onMounted
}
from
'vue'
;
import
{
getTenantPage
}
from
'@/api/tenant'
;
...
...
@@ -76,7 +76,7 @@
{
field
:
'action'
,
title
:
'操作'
,
width
:
2
0
0
,
width
:
2
6
0
,
fixed
:
'right'
,
slots
:
{
default
:
({
row
})
=>
{
...
...
@@ -88,6 +88,9 @@
<
ElButton
link
type
=
"primary"
icon
=
{
Edit
}
onClick
=
{()
=>
handleDisable
(
row
)}
>
{
row
.
staff
.
status
==
'enable'
?
'禁用'
:
'启用'
}
<
/ElButton
>
<
ElButton
link
type
=
"primary"
onClick
=
{()
=>
handleRefresh
(
row
)}
>
重置密码
<
/ElButton
>
<
/
>
);
},
...
...
@@ -130,8 +133,8 @@
// 修改的状态
const
status
=
row
.
staff
.
status
===
'enable'
?
'disable'
:
'enable'
;
await
s
aveLeaderGroup
({
...
row
.
staff
,
await
s
etStatus
({
id
:
row
.
staff
.
id
,
status
});
row
.
staff
.
status
=
status
;
...
...
@@ -141,6 +144,27 @@
plain
:
true
,
});
};
const
handleRefresh
=
async
(
row
)
=>
{
await
ElMessageBox
.
confirm
(
`是否确认重置该用户的密码?`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
);
// 修改的状态
await
restPassword
({
id
:
row
.
staff
.
id
});
ElMessage
({
type
:
'success'
,
message
:
`重置成功!`
,
plain
:
true
,
});
}
const
query
=
()
=>
proTable
.
value
?.
search
();
...
...
src/views/system/riskMemberManage/components/AccountFormModal.vue
View file @
28075edd
...
...
@@ -15,11 +15,6 @@
<el-input
v-model=
"form.phone"
placeholder=
"请输入手机号"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"密码"
prop=
"password"
>
<el-input
v-model=
"form.password"
placeholder=
"请输入密码"
/>
</el-form-item>
</el-col>
<el-col
:span=
"24"
>
<el-form-item
class=
"w-full"
label=
"用户名称"
prop=
"username"
>
<el-input
v-model=
"form.username"
placeholder=
"请输入用户名称"
/>
...
...
@@ -46,7 +41,7 @@
<
script
setup
>
import
{
computed
}
from
'vue'
;
import
{
ref
}
from
'vue'
;
import
{
saveLeaderGroup
}
from
'@/api/user'
;
import
{
saveLeaderGroup
,
saveUser
}
from
'@/api/user'
;
import
{
getDefualtRoles
}
from
'@/api/role'
;
import
{
ElMessage
}
from
'element-plus'
;
...
...
@@ -56,7 +51,6 @@
const
loading
=
ref
(
false
);
const
form
=
ref
({
username
:
''
,
password
:
''
,
phone
:
''
,
status
:
'enable'
,
});
...
...
@@ -73,7 +67,6 @@
};
const
rules
=
ref
({
username
:
{
required
:
true
,
message
:
'请输入用户名称'
,
trigger
:
'blur'
},
password
:
{
required
:
true
,
message
:
'请输入密码'
,
trigger
:
'blur'
},
phone
:
[
{
required
:
true
,
message
:
'请输入手机号'
,
trigger
:
'blur'
},
{
validator
:
validatePhone
,
trigger
:
'blur'
},
...
...
@@ -88,9 +81,11 @@
try
{
await
formRef
.
value
.
validate
();
loading
.
value
=
true
;
if
(
isEdit
.
value
)
{
await
saveUser
(
form
.
value
)
}
else
{
await
saveLeaderGroup
({...
form
.
value
,
role
:
'risk_control_commissioner'
});
}
ElMessage
({
type
:
'success'
,
message
:
isEdit
.
value
?
'修改成功!'
:
'添加成功!'
,
...
...
@@ -106,7 +101,6 @@
form
.
value
=
{
username
:
''
,
roles
:
[],
password
:
''
,
phone
:
''
,
status
:
'enable'
,
};
...
...
src/views/system/riskMemberManage/index.vue
View file @
28075edd
...
...
@@ -25,7 +25,7 @@
import
{
Delete
,
Edit
,
Plus
}
from
'@element-plus/icons-vue'
;
import
{
reactive
,
ref
}
from
'vue'
;
import
{
ElButton
,
ElMessageBox
,
ElMessage
,
ElTag
}
from
'element-plus'
;
import
{
getleaderGroupPage
,
s
aveLeaderGroup
,
batchDeleteByIds
}
from
'@/api/user'
;
import
{
getleaderGroupPage
,
s
etStatus
,
batchDeleteByIds
,
restPassword
}
from
'@/api/user'
;
import
{
useDict
}
from
'@/hooks/useDict'
;
import
{
onMounted
}
from
'vue'
;
import
{
getTenantPage
}
from
'@/api/tenant'
;
...
...
@@ -76,7 +76,7 @@
{
field
:
'action'
,
title
:
'操作'
,
width
:
2
0
0
,
width
:
2
6
0
,
fixed
:
'right'
,
slots
:
{
default
:
({
row
})
=>
{
...
...
@@ -88,6 +88,9 @@
<
ElButton
link
type
=
"primary"
icon
=
{
Edit
}
onClick
=
{()
=>
handleDisable
(
row
)}
>
{
row
.
staff
.
status
==
'enable'
?
'禁用'
:
'启用'
}
<
/ElButton
>
<
ElButton
link
type
=
"primary"
onClick
=
{()
=>
handleRefresh
(
row
)}
>
重置密码
<
/ElButton
>
<
/
>
);
},
...
...
@@ -130,8 +133,8 @@
// 修改的状态
const
status
=
row
.
staff
.
status
===
'enable'
?
'disable'
:
'enable'
;
await
s
aveLeaderGroup
({
...
row
.
staff
,
await
s
etStatus
({
id
:
row
.
staff
.
id
,
status
});
row
.
staff
.
status
=
status
;
...
...
@@ -141,6 +144,27 @@
plain
:
true
,
});
};
const
handleRefresh
=
async
(
row
)
=>
{
await
ElMessageBox
.
confirm
(
`是否确认重置该用户的密码?`
,
'提示'
,
{
confirmButtonText
:
'确认'
,
cancelButtonText
:
'取消'
,
type
:
'warning'
,
}
);
// 修改的状态
await
restPassword
({
id
:
row
.
staff
.
id
});
ElMessage
({
type
:
'success'
,
message
:
`重置成功!`
,
plain
:
true
,
});
}
const
query
=
()
=>
proTable
.
value
?.
search
();
...
...
vite.config.js
View file @
28075edd
...
...
@@ -55,9 +55,9 @@ export default defineConfig(({ command, mode }) => {
port
:
VITE_PORT
,
proxy
:
{
'/api'
:
{
target
:
'http://192.168.31.189:8080'
,
//
target: 'http://192.168.31.189:8080',
// target: 'http://192.168.31.128:8080',
//
target: 'http://8.152.205.9:8080',
target
:
'http://8.152.205.9:8080'
,
changeOrigin
:
true
,
rewrite
:
(
path
)
=>
path
.
replace
(
/^
\/
api/
,
''
),
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment