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
94f75ac8
Commit
94f75ac8
authored
Jul 13, 2020
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新登录接口
parent
fe8c7698
Pipeline
#9867
passed with stages
in 33 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
3 deletions
+15
-3
UsersController.php
app/Http/Controllers/Api/Client/UsersController.php
+7
-1
MediaController.php
app/Http/Controllers/Web/MediaController.php
+1
-1
MediaModel.php
app/Model/MediaModel.php
+7
-1
No files found.
app/Http/Controllers/Api/Client/UsersController.php
View file @
94f75ac8
...
...
@@ -10,6 +10,11 @@ use Illuminate\Support\Facades\DB;
class
UsersController
extends
Controller
{
protected
$domain
=
[
'dev'
=>
'dev-offcncloud.s3-cn-north-1.qiniucs.com'
,
'test'
=>
'test-offcncloud.s3-cn-north-1.qiniucs.com'
,
'master'
=>
'offcncloud.s3-cn-north-1.qiniucs.com'
,
];
/**
* 第三方验权
* @param Request $request
...
...
@@ -126,7 +131,8 @@ class UsersController extends Controller
throw
new
DatabaseException
(
'用户名信息更新失败'
);
}
return
$newtoken
;
$branch
=
empty
(
getenv
(
'branch'
))
?
'test'
:
getenv
(
'branch'
);
return
[
'access_token'
=>
$newtoken
,
'domain'
=>
$this
->
domain
[
$branch
]];
}
else
{
throw
new
DatabaseException
(
'用户名称或者密码错误'
);
...
...
app/Http/Controllers/Web/MediaController.php
View file @
94f75ac8
...
...
@@ -120,7 +120,7 @@ class MediaController extends Controller
$id
=
handler_drive
(
function
()
use
(
$request
,
$id
){
return
MediaModel
::
deleteMediaById
(
$id
);
return
MediaModel
::
deleteMediaById
(
$
request
,
$
id
);
});
...
...
app/Model/MediaModel.php
View file @
94f75ac8
...
...
@@ -332,13 +332,19 @@ class MediaModel extends Eloquent
* @return int
* @throws \Exception
*/
public
static
function
deleteMediaById
(
$id
){
public
static
function
deleteMediaById
(
$
request
,
$
id
){
try
{
$media
=
MediaModel
::
where
(
'_id'
,
$id
)
->
first
();
if
(
empty
(
$media
)){
throw
new
\Exception
(
'媒资不存在!'
);
}
if
(
$request
->
token_username
!=
'offcn'
){
}
$flag
=
MediaModel
::
destroy
(
$id
);
if
(
!
$flag
){
throw
new
\Exception
(
'删除失败'
);
...
...
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