Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7379b68f
authored
Dec 26, 2025
by
skynono
Committed by
GitHub
Dec 26, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: support first bind update password (#2520)
parent
2570788b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
controller/user.go
+4
-1
web/src/components/settings/PersonalSetting.jsx
+4
-4
No files found.
controller/user.go
View file @
7379b68f
...
...
@@ -763,7 +763,10 @@ func checkUpdatePassword(originalPassword string, newPassword string, userId int
if
err
!=
nil
{
return
}
if
!
common
.
ValidatePasswordAndHash
(
originalPassword
,
currentUser
.
Password
)
{
// 密码不为空,需要验证原密码
// 支持第一次账号绑定时原密码为空的情况
if
!
common
.
ValidatePasswordAndHash
(
originalPassword
,
currentUser
.
Password
)
&&
currentUser
.
Password
!=
""
{
err
=
fmt
.
Errorf
(
"原密码错误"
)
return
}
...
...
web/src/components/settings/PersonalSetting.jsx
View file @
7379b68f
...
...
@@ -314,10 +314,10 @@ const PersonalSetting = () => {
};
const
changePassword
=
async
()
=>
{
if
(
inputs
.
original_password
===
''
)
{
showError
(
t
(
'请输入原密码!'
));
return
;
}
//
if (inputs.original_password === '') {
//
showError(t('请输入原密码!'));
//
return;
//
}
if
(
inputs
.
set_new_password
===
''
)
{
showError
(
t
(
'请输入新密码!'
));
return
;
...
...
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