天天看点

Typora安装配置PicGo-Core,picgo-plugin-web-uploader安装配置PicGo-Core,picgo-plugin-web-uploader

安装配置PicGo-Core,picgo-plugin-web-uploader

这里写目录标题

  • 安装配置PicGo-Core,picgo-plugin-web-uploader
    • 下载
    • 安装插件picgo-plugin-web-uploader
    • 配置
    • 你可能会遇到的问题-underfined

下载

https://github.com/PicGo/PicGo-Core

npm install picgo -g

# or

yarn global add picgo
           

安装插件picgo-plugin-web-uploader

https://github.com/yuki-xin/picgo-plugin-web-uploader

picgo install picgo-plugin-web-uploader

# 修改默认上传方式
# picgo use uploader
           

配置

编辑配置文件:

C:\Users\用户\.picgo\config.json

自己根据需求填写,这里注意以下标准JSON需要中的key和value均需要使用反斜杠

\

,转义。

url: 图床上传API地址

paramName: POST参数名

jsonPath: 图片URL所在返回值的JsonPath(eg:data.url)

customHeader: 自定义请求头 标准JSON(eg: {“key”:“value”}

customBody: 自定义Body 标准JSON(eg: {“key”:“value”})

{
  "picBed": {
    "web-uploader": {
      "customBody": "",
      "customHeader": "{\"token\": \"在这里填写toekn,如果你需要的话\"}",
      "jsonPath": "data.url",
      "paramName": "image",
      "url": "上传地址API"
    },
    "uploader": "web-uploader"
  },
  "picgoPlugins": {
    "picgo-plugin-web-uploader": true
  }
}
           
Typora安装配置PicGo-Core,picgo-plugin-web-uploader安装配置PicGo-Core,picgo-plugin-web-uploader

你可能会遇到的问题-underfined

如果你在上传的时候他显示 undefined

Typora安装配置PicGo-Core,picgo-plugin-web-uploader安装配置PicGo-Core,picgo-plugin-web-uploader

那么你的配置可能是这样的—>

"customHeader": 
      {
        "token": "123456789"
      },
           

请按这样我那样修改,谢谢。

"customHeader": "{\"token\": \"123456789\"}",