Skip to content

Commit

Permalink
feat: 更新CLI脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
ATQQ committed Jan 21, 2024
1 parent 3fcdd62 commit 9522a22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"keywords": [],
"main": "token.js",
"scripts": {
"generate": "node ./token.js"
"generate": "node ./token.js",
"generare:copy": "copy=true node ./token.js"
},
"dependencies": {
"copy-paste": "^1.5.3",
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/token.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ if (!process.env.CI) {
console.log(envToken)
})
}

fs.writeFileSync(path.join(__dirname, '../client/.env.local'), `VITE_APP_QINIU_TOKEN=${envToken}`)
if (!process.env.copy) {
fs.writeFileSync(path.join(__dirname, '../client/.env.local'), `VITE_APP_QINIU_TOKEN=${envToken}`)
}
2 changes: 1 addition & 1 deletion packages/client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useConfigStore } from './store';
import { useLocalStorage } from '@vueuse/core';
const store = useConfigStore()
// 默认取用户设置的token
const qiniuToken = useLocalStorage('qiniu-token', '')
const qiniuToken = useLocalStorage('qiniu-token', undefined)
watch(qiniuToken, (newValue) => {
store.parseQiniuToken(newValue)
Expand Down

0 comments on commit 9522a22

Please sign in to comment.