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
613b89b7
Commit
613b89b7
authored
Sep 22, 2022
by
杨昕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
百度添加域名模块
parent
e0f4c75a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
7 deletions
+25
-7
MediaController.php
app/Http/Controllers/Api/Client/MediaController.php
+3
-1
BaiduOssModel.php
app/Model/BaiduOssModel.php
+16
-0
database.php
config/database.php
+6
-6
No files found.
app/Http/Controllers/Api/Client/MediaController.php
View file @
613b89b7
...
...
@@ -87,7 +87,9 @@ class MediaController extends Controller
$data
=
[
"token"
=>
$token
,
'domain'
=>
$domain
];
break
;
case
self
::
OSS_BAIDU
:
$data
=
BaiduOssModel
::
getBaiduOssToken
(
$request
);
$token
=
BaiduOssModel
::
getBaiduOssToken
(
$request
);
$domain
=
BaiduOssModel
::
getDomain
();
$data
=
[
"token"
=>
$token
,
"domain"
=>
$domain
];
break
;
default
:
$token
=
QiniuModel
::
uploadToken
(
$this
->
bucketList
[
$branch
],
$key
);
...
...
app/Model/BaiduOssModel.php
View file @
613b89b7
...
...
@@ -33,4 +33,19 @@ class BaiduOssModel
return
$result
[
"data"
];
}
public
static
function
getDomain
(){
try
{
$branch
=
getenv
(
'branch'
)
?
getenv
(
'branch'
)
:
"test"
;
if
(
$branch
==
"test"
)
{
$domain
=
"https://media-test-bce.cdn.bcebos.com"
;
}
else
{
$domain
=
"https://media-bce.cdn.bcebos.com"
;
}
}
catch
(
\Exception
$exception
){
throw
new
DatabaseException
(
$exception
->
getMessage
());
}
return
domain
;
}
}
\ No newline at end of file
config/database.php
View file @
613b89b7
...
...
@@ -85,8 +85,8 @@ return [
'mongodb'
=>
[
'driver'
=>
'mongodb'
,
'host'
=>
env
(
'mg_host'
)
??
'
mongo.eoffcn
.com'
,
'port'
=>
env
(
'mg_port'
)
??
'
280
17'
,
'host'
=>
env
(
'mg_host'
)
??
'
dds-2ze877d1a56f53141986-pub.mongodb.rds.aliyuncs
.com'
,
'port'
=>
env
(
'mg_port'
)
??
'
37
17'
,
'database'
=>
'video_media'
,
'username'
=>
env
(
'mg_username'
)
??
'root'
,
'password'
=>
env
(
"mg_password"
)
??
'FHHTH98AWAPoyweEasdfadfaaf'
,
...
...
@@ -131,17 +131,17 @@ return [
// 'port' => env('REDIS_PORT', 6379),
// 'database' => env('REDIS_DB', 2),
'host'
=>
'
offcn-redis-svc
'
,
'host'
=>
'
security.proxy.eoffcn.com
'
,
'password'
=>
'test.eoffcn.com'
,
'port'
=>
6
379
,
'port'
=>
6
4793
,
'database'
=>
1
,
],
'session'
=>
[
'host'
=>
'
offcn-redis-svc
'
,
'host'
=>
'
security.proxy.eoffcn.com
'
,
'password'
=>
'test.eoffcn.com'
,
'port'
=>
6
379
,
'port'
=>
6
4793
,
'database'
=>
2
,
],
...
...
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