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
069ec102
authored
Nov 01, 2022
by
杨树贤
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
登陆注册接口
parent
4be560a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
11 deletions
.idea/workspace.xml
app/Http/Controllers/Api/AuthApiController.php
app/Http/Kernel.php
app/Models/User.php
routes/api.php
.idea/workspace.xml
View file @
069ec102
...
@@ -4,6 +4,7 @@
...
@@ -4,6 +4,7 @@
<list
default=
"true"
id=
"fb90add0-1393-48c2-9f26-72365d42cd03"
name=
"变更"
comment=
""
>
<list
default=
"true"
id=
"fb90add0-1393-48c2-9f26-72365d42cd03"
name=
"变更"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
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/Controllers/Api/AuthApiController.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Controllers/Api/AuthApiController.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/Http/Kernel.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Http/Kernel.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Models/User.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Models/User.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/app/Models/User.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/app/Models/User.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/routes/api.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/routes/api.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/routes/api.php"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/routes/api.php"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/storage/app/.gitignore"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/storage/app/.gitignore"
afterDir=
"false"
/>
...
@@ -184,10 +185,21 @@
...
@@ -184,10 +185,21 @@
<updated>
1666170258203
</updated>
<updated>
1666170258203
</updated>
<workItem
from=
"1666170260162"
duration=
"17108000"
/>
<workItem
from=
"1666170260162"
duration=
"17108000"
/>
<workItem
from=
"1666835076791"
duration=
"693000"
/>
<workItem
from=
"1666835076791"
duration=
"693000"
/>
<workItem
from=
"1667266026118"
duration=
"595000"
/>
</task>
</task>
<servers
/>
<servers
/>
</component>
</component>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<component
name=
"TypeScriptGeneratedFilesManager"
>
<option
name=
"version"
value=
"3"
/>
<option
name=
"version"
value=
"3"
/>
</component>
</component>
<component
name=
"Vcs.Log.History.Properties"
>
<option
name=
"COLUMN_ID_ORDER"
>
<list>
<option
value=
"Default.Root"
/>
<option
value=
"Default.Author"
/>
<option
value=
"Default.Date"
/>
<option
value=
"Default.Subject"
/>
</list>
</option>
</component>
</project>
</project>
\ No newline at end of file
app/Http/Controllers/Api/AuthApiController.php
View file @
069ec102
...
@@ -30,16 +30,10 @@ class AuthApiController extends Controller
...
@@ -30,16 +30,10 @@ class AuthApiController extends Controller
return
$this
->
setError
(
$validator
->
errors
()
->
first
());
return
$this
->
setError
(
$validator
->
errors
()
->
first
());
}
}
event
(
new
Registered
(
$user
=
User
::
createUser
(
$request
->
all
())));
$user
=
User
::
createUser
(
$request
->
all
());
$this
->
guard
()
->
login
(
$user
);
if
(
$response
=
$this
->
registered
(
$request
,
$user
))
{
return
$this
->
setSuccess
(
'register success'
);
}
return
$this
->
setError
(
'register failure'
);
\Auth
::
login
(
$user
);
return
$this
->
setSuccess
(
'register success'
);
}
}
...
...
app/Http/Kernel.php
View file @
069ec102
...
@@ -42,6 +42,9 @@ class Kernel extends HttpKernel
...
@@ -42,6 +42,9 @@ class Kernel extends HttpKernel
'api'
=>
[
'api'
=>
[
'throttle:60,1'
,
'throttle:60,1'
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\Illuminate\Routing\Middleware\SubstituteBindings
::
class
,
\App\Http\Middleware\EncryptCookies
::
class
,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse
::
class
,
\Illuminate\Session\Middleware\StartSession
::
class
,
],
],
];
];
...
...
app/Models/User.php
View file @
069ec102
...
@@ -22,6 +22,8 @@ class User extends Authenticatable implements MustVerifyEmail
...
@@ -22,6 +22,8 @@ class User extends Authenticatable implements MustVerifyEmail
'password'
,
'password'
,
];
];
public
$timestamps
=
false
;
/**
/**
* The attributes that should be hidden for arrays.
* The attributes that should be hidden for arrays.
*
*
...
...
routes/api.php
View file @
069ec102
...
@@ -14,8 +14,8 @@ use Illuminate\Support\Facades\Route;
...
@@ -14,8 +14,8 @@ use Illuminate\Support\Facades\Route;
|
|
*/
*/
Route
::
middleware
([])
->
namespace
(
'Api'
)
->
group
(
function
()
{
Route
::
middleware
([
'api'
])
->
namespace
(
'Api'
)
->
group
(
function
()
{
Route
::
POST
(
'/user/login'
,
'AuthApiController@login'
);
Route
::
ANY
(
'/user/login'
,
'AuthApiController@login'
);
Route
::
POST
(
'/user/register'
,
'AuthApiController@register'
);
Route
::
POST
(
'/user/register'
,
'AuthApiController@register'
);
});
});
...
...
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