Skip to content

Commit

Permalink
chore: use upyun demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Sep 30, 2024
1 parent 89a260b commit ec830cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ jobs:
QINIU_PREFIX: ${{vars.QINIU_PREFIX}}
QINIU_SCOPE: ${{vars.QINIU_SCOPE}}
QINIU_EXPIRES: ${{vars.QINIU_EXPIRES}}
UPYUN_OPERATOR: ${{secrets.UPYUN_OPERATOR}}
UPYUN_PASSWORD: ${{secrets.UPYUN_PASSWORD}}
UPYUN_BUCKET: ${{secrets.UPYUN_BUCKET}}
UPYUN_DOMAIN: ${{vars.UPYUN_DOMAIN}}
UPYUN_PREFIX: ${{vars.UPYUN_PREFIX}}
UPYUN_SCOPE: ${{vars.UPYUN_SCOPE}}
UPYUN_EXPIRES: ${{vars.UPYUN_EXPIRES}}
run: |
echo ${{ github.workspace }}
cd ./packages/client
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/upyun-token.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const prefix = process.env.UPYUN_PREFIX
const scope = process.env.UPYUN_SCOPE
const method = 'PUT'
const uriPrefix = `/${bucket}/${prefix}/${scope}`
const expire = new Date().getTime() + (+process.env.UPYUN_EXPIRES * 1000) || 1000 * 60 * 60 * 24 * 90 // 90天的过期时间
const expire = new Date().getTime() + ((+process.env.UPYUN_EXPIRES * 1000) || 1000 * 60 * 60 * 24 * 90) // 90天的过期时间
console.log('expire', new Date(expire).toLocaleString())
const domain = process.env.UPYUN_DOMAIN

Expand Down
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"dev": "vite",
"dev:test": "VITE_APP_FAKE_UPLOAD=true vite",
"build": "vite build",
"build:github": "node ./../cli/token.js && vite build --base /image-bed-qiniu/",
"build:github": "node ./../cli/upyun-token.js && vite build --base /image-bed-qiniu/",
"preview": "vite preview",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down

0 comments on commit ec830cc

Please sign in to comment.