Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
loveisland
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
刘小敏
loveisland
Commits
550e34f8
Commit
550e34f8
authored
May 08, 2026
by
刘小敏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新用户信息接口优化 健壮代码
parent
b6ee4d58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
User.php
addons/shopro/controller/user/User.php
+11
-6
No files found.
addons/shopro/controller/user/User.php
View file @
550e34f8
...
@@ -94,15 +94,20 @@ class User extends Common
...
@@ -94,15 +94,20 @@ class User extends Common
if
(
!
$this
->
request
->
isPost
())
{
if
(
!
$this
->
request
->
isPost
())
{
$this
->
error
(
''
);
$this
->
error
(
''
);
}
}
$user
=
auth_user
();
try
{
$user
=
auth_user
();
$params
=
$this
->
request
->
only
([
'avatar'
,
'nickname'
,
'birthday'
]);
$params
=
$this
->
request
->
only
([
'avatar'
,
'nickname'
,
'birthday'
]);
$this
->
svalidate
(
$params
);
$this
->
svalidate
(
$params
);
$user
->
save
(
$params
);
$user
->
save
(
$params
);
$user
->
hidden
([
'password'
,
'salt'
,
'createtime'
,
'updatetime'
,
'deletetime'
,
'remember_token'
,
'login_fail'
,
'login_ip'
,
'login_time'
]);
$user
->
hidden
([
'password'
,
'salt'
,
'createtime'
,
'updatetime'
,
'deletetime'
,
'remember_token'
,
'login_fail'
,
'login_ip'
,
'login_time'
]);
$this
->
success
(
'更新成功'
,
$user
);
$this
->
success
(
'更新成功'
,
$user
);
}
catch
(
\Exception
$e
)
{
$this
->
error
(
$e
->
getMessage
());
}
}
}
/**
/**
...
...
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