Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
UserAdminV2
Overview
Overview
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
庄欣
UserAdminV2
Commits
90cdfcfb
Commit
90cdfcfb
authored
Oct 31, 2016
by
庄欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不传TOKEN将报错
parent
e530c815
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
app/Member/v1/Controller/User.php
+4
-1
routes/api.php
+1
-1
No files found.
app/Member/v1/Controller/User.php
View file @
90cdfcfb
...
...
@@ -94,8 +94,11 @@ class User extends Controller
/**
* 根据CODE获取用户信息
*/
public
function
getUserIdByHashCode
(
$code
)
public
function
getUserIdByHashCode
(
$code
=
""
)
{
if
(
empty
(
$code
))
{
return
Response
::
error
(
"未登录"
,
HttpStatus
::
HttpUnauthorized
);
}
$user
=
UserModel
::
where
(
"access_token"
,
$code
)
->
first
();
try
{
$user
=
UserModel
::
where
(
"access_token"
,
$code
)
->
first
();
...
...
routes/api.php
View file @
90cdfcfb
...
...
@@ -72,7 +72,7 @@ Route::group(["prefix" => "user", 'namespace' => Provider::getNamespace("member"
Route
::
get
(
"/auth/
{
code?
}
"
,
"User@code"
);
Route
::
get
(
"/show/
{
code
}
"
,
"User@getUserByHashCode"
)
->
where
([
'code'
=>
'\S+'
]);
Route
::
get
(
"/search"
,
"User@search"
);
Route
::
get
(
"/getid/
{
code
}
"
,
"User@getUserIdByHashCode"
);
Route
::
get
(
"/getid/
{
code
?
}
"
,
"User@getUserIdByHashCode"
);
});
...
...
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