npm install --save sunland-upload-sdk
在项目根目录新建如下xxx.json
{
"SDUrl": "https://sfs-api.shangdejigou.cn/api/auth/",
"remotePath": "https://sfs-public.shangdejigou.cn/sunlands_back_freestudy",
"accessKey": "xxx",
"secretKey": "xxx",
"prefix" : "/fe/ananas",
"localPath" : "ananas"
}
SDUrl
获取文件系统接口地址remotePath
文件系统配置的cdn地址accessKey
accessKeysecretKey
secretKeyprefix
拼接到cdn网址后(一般为项目名称)localPath
本地需要上传的路径
-package.json
{
"script": {
"upload": "upload xxx.json"
}
}
- tips
upload
为暴露的cli
命令