How to use the qiniu.SecretKey function in qiniu

To help you get started, we’ve selected a few qiniu examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shd101wyy / mume / src / image-uploader.ts View on Github external
export function uploadImage(
  imageFilePath: string,
  {
    method = "imgur",
    qiniu = { AccessKey: "", SecretKey: "", Bucket: "", Domain: "" },
  },
): Promise {
  if (method === "imgur") {
    return imgurUploadImage(imageFilePath);
  } else if (method === "qiniu") {
    return qiniuUploadImage(
      imageFilePath,
      qiniu.AccessKey,
      qiniu.SecretKey,
      qiniu.Bucket,
      qiniu.Domain,
    );
  } else {
    // sm.ms
    return smmsUploadImage(imageFilePath);
  }
}