picgo-plugin-smms-user
Advanced tools
Comparing version
{ | ||
"name": "picgo-plugin-smms-user", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "SMMS-用户", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -15,3 +15,3 @@ module.exports = (ctx) => { | ||
contentType: 'multipart/form-data', | ||
Authorization: '6PcK1QgjaIhbDIGjp0J54w9lVK1DoiNz'||undefined, | ||
Authorization: Authorization||undefined, | ||
}, | ||
@@ -29,2 +29,7 @@ formData: { | ||
const handle = async (ctx) => { | ||
let userConfig = ctx.getConfig('picBed.smms-user') | ||
if (!userConfig) { | ||
throw new Error('Can\'t find uploader config') | ||
} | ||
const Authorization = userConfig.Authorization | ||
const imgList = ctx.output; | ||
@@ -36,3 +41,3 @@ for (let i in imgList) { | ||
} | ||
const postConfig = postOptions(imgList[i].fileName, image); | ||
const postConfig = postOptions(Authorization, imgList[i].fileName, image); | ||
let body = await ctx.Request.request(postConfig); | ||
@@ -39,0 +44,0 @@ |
4211
4.65%78
6.85%