Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
杨树贤
/
ucenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
53a50fbf
authored
Jan 16, 2024
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
注册登录完善
parent
17b8616e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
3 deletions
app/Http/Controllers/Api/AuthController.php
app/Http/Requests/UserRegister.php
app/Http/Services/UserService.php
app/Http/Controllers/Api/AuthController.php
View file @
53a50fbf
...
...
@@ -18,6 +18,7 @@ class AuthController extends Controller
'email'
,
'password'
,
'salt'
,
'init_org_id'
,
]);
$user
=
UserService
::
register
(
$data
);
...
...
app/Http/Requests/UserRegister.php
View file @
53a50fbf
...
...
@@ -30,7 +30,15 @@ class UserRegister extends FormRequest
'password'
=>
'required'
,
'salt'
=>
'required'
,
'mobile'
=>
'required_without:email'
,
'email'
=>
'required_without:mobile'
'email'
=>
'required_without:mobile'
,
'init_org_id'
=>
'required'
];
}
public
function
attributes
()
{
return
[
'init_org_id'
=>
'组织id'
];
}
...
...
app/Http/Services/UserService.php
View file @
53a50fbf
...
...
@@ -31,7 +31,7 @@ class UserService
'create_time'
,
])
->
where
(
'uc_id'
,
$ucId
)
->
first
();
UserModel
::
where
(
'uc_id'
,
$user
[
'uc_id'
])
->
update
([
'last_login_time'
],
time
()
);
UserModel
::
where
(
'uc_id'
,
$user
[
'uc_id'
])
->
update
([
'last_login_time'
=>
time
()]
);
return
$user
;
}
...
...
@@ -58,7 +58,7 @@ class UserService
'create_time'
,
])
->
where
(
'password'
,
$passwordHash
)
->
first
();
UserModel
::
where
(
'uc_id'
,
$user
[
'uc_id'
])
->
update
([
'last_login_time'
],
time
()
);
UserModel
::
where
(
'uc_id'
,
$user
[
'uc_id'
])
->
update
([
'last_login_time'
=>
time
()]
);
return
$user
?:
[];
...
...
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