Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
broadcast_cloud
/
web-live
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
2
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d6b48561
authored
Oct 12, 2020
by
xiawei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upload oss
parent
27e524dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
43 deletions
+4
-43
nuxt.config.js
+2
-22
upload.js
+2
-21
No files found.
nuxt.config.js
View file @
d6b48561
const
{
version
}
=
require
(
'./package.json'
);
const
BASE_URL
=
'/live/'
;
const
BASE_URL
=
'/live/'
;
const
globalEnv
=
require
(
'./config/global.js'
);
const
globalEnv
=
require
(
'./config/global.js'
);
const
modeEnv
=
process
.
env
.
mode
?
require
(
`./config/
${
process
.
env
.
mode
}
.js`
)
:
{};
const
modeEnv
=
process
.
env
.
mode
?
require
(
`./config/
${
process
.
env
.
mode
}
.js`
)
:
{};
...
@@ -103,7 +104,7 @@ export default {
...
@@ -103,7 +104,7 @@ export default {
*/
*/
// publicPath: `/${BUILD_DIST.toLowerCase()}/`,
// publicPath: `/${BUILD_DIST.toLowerCase()}/`,
publicPath
:
process
.
env
.
run_server
publicPath
:
process
.
env
.
run_server
?
`//static-
${
process
.
env
.
run_server
}
.guangdianyun.tv/live/
${
getTime
()
}
`
?
`//static-
${
process
.
env
.
run_server
}
.guangdianyun.tv/live/
${
version
}
`
:
`/
${
BUILD_DIST
.
toLowerCase
()}
/`
,
:
`/
${
BUILD_DIST
.
toLowerCase
()}
/`
,
extend
(
config
,
ctx
)
{
extend
(
config
,
ctx
)
{
// console.log(ctx);
// console.log(ctx);
...
@@ -113,24 +114,3 @@ export default {
...
@@ -113,24 +114,3 @@ export default {
plugins
:
[]
plugins
:
[]
}
}
};
};
/**
*日期
*/
function
getTime
()
{
let
format
=
'yyMMdd'
;
const
date
=
new
Date
();
const
o
=
{
'y+'
:
String
(
date
.
getFullYear
()).
substr
(
2
,
2
),
'M+'
:
String
(
date
.
getMonth
()
+
1
),
'd+'
:
String
(
date
.
getDate
())
};
for
(
const
k
in
o
)
{
if
(
new
RegExp
(
`(
${
k
}
)`
).
test
(
format
))
{
let
str
=
o
[
k
]
+
''
;
str
=
str
.
length
>
1
?
str
:
0
+
str
;
format
=
format
.
replace
(
RegExp
.
$1
,
str
);
}
}
return
format
;
}
upload.js
View file @
d6b48561
const
{
version
}
=
require
(
'./package.json'
);
const
OSS
=
require
(
'ali-oss'
);
const
OSS
=
require
(
'ali-oss'
);
const
fs
=
require
(
'fs'
);
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
path
=
require
(
'path'
);
...
@@ -79,24 +80,4 @@ async function upload(dirName) {
...
@@ -79,24 +80,4 @@ async function upload(dirName) {
console
.
log
(
dirName
+
'上传oss成功失败'
,
err
);
console
.
log
(
dirName
+
'上传oss成功失败'
,
err
);
}
}
}
}
/**
upload
(
`/live/
${
version
}
`
);
*日期
*/
function
getTime
()
{
let
format
=
'yyMMdd'
;
const
date
=
new
Date
();
const
o
=
{
'y+'
:
String
(
date
.
getFullYear
()).
substr
(
2
,
2
),
'M+'
:
String
(
date
.
getMonth
()
+
1
),
'd+'
:
String
(
date
.
getDate
())
};
for
(
const
k
in
o
)
{
if
(
new
RegExp
(
`(
${
k
}
)`
).
test
(
format
))
{
let
str
=
o
[
k
]
+
''
;
str
=
str
.
length
>
1
?
str
:
0
+
str
;
format
=
format
.
replace
(
RegExp
.
$1
,
str
);
}
}
return
format
;
}
upload
(
`/live/
${
getTime
()}
`
);
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