Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
media-resource
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨昕
media-resource
Commits
eae26344
Commit
eae26344
authored
Jul 16, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加第三方验证
parent
624b58b7
Pipeline
#9902
passed with stages
in 33 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
LoginController.php
app/Http/Controllers/Web/LoginController.php
+7
-1
MemberController.php
app/Http/Controllers/Web/MemberController.php
+2
-2
MediaModel.php
app/Model/MediaModel.php
+1
-1
No files found.
app/Http/Controllers/Web/LoginController.php
View file @
eae26344
...
@@ -38,9 +38,10 @@ class LoginController extends Controller
...
@@ -38,9 +38,10 @@ class LoginController extends Controller
}
}
$user
=
DB
::
connection
(
'mongodb'
)
//选择使用mongodb
$user
=
DB
::
connection
(
'mongodb'
)
//选择使用mongodb
->
collection
(
'users'
)
->
where
(
'name'
,
$request
->
name
)
->
first
();
->
collection
(
'users'
)
->
where
(
'name'
,
$request
->
name
)
->
where
(
'user_type'
,
1
)
->
first
();
if
(
$user
){
if
(
$user
){
if
(
$user
[
'password'
]
==
md5
(
$request
->
password
)){
if
(
$user
[
'password'
]
==
md5
(
$request
->
password
)){
$result
=
true
;
$result
=
true
;
}
else
{
}
else
{
...
@@ -51,6 +52,11 @@ class LoginController extends Controller
...
@@ -51,6 +52,11 @@ class LoginController extends Controller
return
error
(
'用户验证失败'
);
return
error
(
'用户验证失败'
);
}
}
if
(
$user
[
'status'
]){
return
error
(
'用户已被限制,请联系管理员'
);
}
$id
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$id
=
(
$user
[
'_id'
])
->
jsonSerialize
();
$user
[
'_id'
]
=
$id
[
'$oid'
];
$user
[
'_id'
]
=
$id
[
'$oid'
];
...
...
app/Http/Controllers/Web/MemberController.php
View file @
eae26344
...
@@ -162,9 +162,9 @@ class MemberController extends Controller
...
@@ -162,9 +162,9 @@ class MemberController extends Controller
* @throws ControllerException
* @throws ControllerException
* @throws \App\Exceptions\FormException
* @throws \App\Exceptions\FormException
*/
*/
public
function
disable
(
Request
$request
,
$id
)
public
function
disable
(
Request
$request
)
{
{
$id
=
$request
->
id
;
if
(
!
$this
->
checkOwnHandle
(
$id
))
{
if
(
!
$this
->
checkOwnHandle
(
$id
))
{
throw
new
\App\Exceptions\FormException
(
'你不能操作别人的'
);
throw
new
\App\Exceptions\FormException
(
'你不能操作别人的'
);
}
}
...
...
app/Model/MediaModel.php
View file @
eae26344
...
@@ -76,7 +76,7 @@ class MediaModel extends Eloquent
...
@@ -76,7 +76,7 @@ class MediaModel extends Eloquent
$aggregate
[][
'$match'
][
'end_time'
]
=
[
'$lt'
=>
$request
->
end_time
];
$aggregate
[][
'$match'
][
'end_time'
]
=
[
'$lt'
=>
$request
->
end_time
];
}
}
$aggregate
[][
'$sort'
]
=
[
'
create
_time'
=>
$sort
];
$aggregate
[][
'$sort'
]
=
[
'
start
_time'
=>
$sort
];
$count
=
sizeof
(
$collection
->
aggregate
(
$aggregate
)
->
toArray
());
$count
=
sizeof
(
$collection
->
aggregate
(
$aggregate
)
->
toArray
());
...
...
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