Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
c291c434
Commit
c291c434
authored
May 10, 2020
by
庄冰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oss
parent
42538b27
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
fqboss/app/base/controller/impl/uploadCtl.js
+21
-3
No files found.
fqboss/app/base/controller/impl/uploadCtl.js
View file @
c291c434
var
System
=
require
(
"../../system"
)
var
System
=
require
(
"../../system"
)
const
crypto
=
require
(
'crypto'
);
const
crypto
=
require
(
'crypto'
);
var
fs
=
require
(
"fs"
);
var
fs
=
require
(
"fs"
);
var
accesskey
=
'DHmRtFlw2Zr3KaRwUFeiu7FWATnmla'
;
// var accesskey='DHmRtFlw2Zr3KaRwUFeiu7FWATnmla';
var
accessKeyId
=
'LTAIyAUK8AD04P5S'
;
// var accessKeyId='LTAIyAUK8AD04P5S';
var
accesskey
=
'3KV9nIwW8qkTGlrPmAe3HnR3fzM6r5'
;
var
accessKeyId
=
'LTAI4GC5tSKvqsH2hMqj6pvd'
;
var
url
=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com"
;
var
url
=
"https://gsb-zc.oss-cn-beijing.aliyuncs.com"
;
class
UploadCtl
{
class
UploadCtl
{
constructor
(){
constructor
(){
...
@@ -13,8 +16,23 @@ class UploadCtl{
...
@@ -13,8 +16,23 @@ class UploadCtl{
//sed 's/{position}/{content}/g' {path}
//sed 's/{position}/{content}/g' {path}
}
}
async
getOssConfig
(){
async
getOssConfig
(){
var
date
=
new
Date
();
var
month
=
date
.
getMonth
()
+
1
;
month
=
month
.
toString
();
if
(
month
<
10
){
month
=
"0"
+
month
;
}
var
day
=
date
.
getDate
().
toString
();
if
(
day
<
10
){
day
=
"0"
+
day
;
}
var
time
=
date
.
getFullYear
().
toString
()
+
month
+
day
;
let
timestamp
=
date
.
getTime
();
//当前的时间戳
timestamp
=
timestamp
+
10
*
60
*
60
*
1000
;
//格式化时间获取年月日
var
dateAfter
=
new
Date
(
timestamp
);
var
policyText
=
{
var
policyText
=
{
"expiration"
:
"2119-12-31T16:00:00.000Z"
,
"expiration"
:
dateAfter
,
"conditions"
:[
"conditions"
:[
[
"content-length-range"
,
0
,
1048576000
],
[
"content-length-range"
,
0
,
1048576000
],
[
"starts-with"
,
"$key"
,
"zc"
]
[
"starts-with"
,
"$key"
,
"zc"
]
...
...
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