Commit 6e30de44 by 孙亚楠

d

parent 0dbb6890
......@@ -8,14 +8,14 @@ class QrClient{
/**
* fn:生成二维码
* @return buffer
* @return http连接 上传失败后返回null
* @param key
* @returns {Promise<void>}
*/
async generateQR(text){
try {
if(!text){
return;
return null;
}
let key = "_"+new Date().getTime(), filePath = settings.localPath();
var qr_png = qr.image(text, {size :10 });
......@@ -25,7 +25,6 @@ class QrClient{
return null;
}
let urlRes = await new ossClient().upfile(key,`${filePath}${key}.png`);
fs.unlink(`${filePath}${key}.png`, (err) => {
if (err){
console.log(`二维码删除失败`);
......@@ -35,6 +34,7 @@ class QrClient{
return urlRes.url;
}catch (e) {
console.log(e);
return null;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment