Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
semour
/
semour_web
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
4e77187f
authored
Nov 10, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
注册新增字段
parent
68bb6237
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
.idea/workspace.xml
app/Http/Controllers/Api/AuthApiController.php
app/Models/UserModel.php
.idea/workspace.xml
View file @
4e77187f
...
...
@@ -2,9 +2,9 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"fb90add0-1393-48c2-9f26-72365d42cd03"
name=
"变更"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.env"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.env"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Requests/UserRegister.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Requests/UserRegister.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Http/Controllers/Api/AuthApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/AuthApiController.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Models/UserModel.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Models/UserModel.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/app.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/app.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/bootstrap/cache/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
...
...
@@ -188,7 +188,7 @@
<workItem
from=
"1666835076791"
duration=
"693000"
/>
<workItem
from=
"1667266026118"
duration=
"40321000"
/>
<workItem
from=
"1667959054458"
duration=
"183000"
/>
<workItem
from=
"1667986756173"
duration=
"3
354
000"
/>
<workItem
from=
"1667986756173"
duration=
"3
812
000"
/>
</task>
<servers
/>
</component>
...
...
app/Http/Controllers/Api/AuthApiController.php
View file @
4e77187f
...
...
@@ -31,9 +31,9 @@ class AuthApiController extends Controller
if
(
$cachedEmailCode
!=
$request
->
input
(
'email_code'
))
{
return
$this
->
setError
(
'Email code invalid'
);
}
$user
=
UserModel
::
createUser
(
$request
->
all
());
$user
Id
=
UserModel
::
createUser
(
$request
->
all
());
\Auth
::
login
(
$user
);
\Auth
::
login
UsingId
(
$userId
);
return
$this
->
setSuccess
(
'Register success'
);
}
...
...
app/Models/UserModel.php
View file @
4e77187f
...
...
@@ -18,11 +18,6 @@ class UserModel extends Authenticatable implements MustVerifyEmail
*
* @var array
*/
protected
$fillable
=
[
'name'
,
'email'
,
'password'
,
];
public
$timestamps
=
false
;
...
...
@@ -47,12 +42,14 @@ class UserModel extends Authenticatable implements MustVerifyEmail
public
static
function
createUser
(
$data
)
{
return
UserModel
::
create
([
return
UserModel
::
insertGetId
([
'first_name'
=>
$data
[
'first_name'
],
'last_name'
=>
$data
[
'last_name'
],
'email'
=>
$data
[
'email'
],
'phone'
=>
$data
[
'phone'
],
'email_verified_at'
=>
now
(),
'company_name'
=>
$data
[
'company_name'
],
'account_properties'
=>
$data
[
'account_properties'
],
'password'
=>
Hash
::
make
(
$data
[
'password'
]),
]);
}
...
...
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