Commit 53e725a5 authored by Damon's avatar Damon

refactor: 入驻上传图片地址修改

parent 47fd0bc1
......@@ -3,7 +3,8 @@ const {
chooseImage,
chooseVideo,
qiniuUpload,
urlUpload
urlUpload,
randomChar
} = require("./utils");
import {
mergeConfig
......@@ -16,9 +17,17 @@ export default class fileUpload extends request {
}
//七牛云上传图片
async qnImgUpload(options = {}) {
let files;
let files
try {
files = await chooseImage(options);
const lists = await chooseImage(options);
files = lists.map(v => {
const key = randomChar(10)
return {
...v,
key: key,
src: key
}
})
// 选择完成回调
options.onSelectComplete && options.onSelectComplete(files);
} catch (err) {
......
......@@ -9,7 +9,7 @@ export const randomChar = function(l, url = "") {
tmp += x.charAt(Math.ceil(Math.random() * 100000000) % x.length);
}
return (
"file/" +
"scn/file/" +
url +
time.getTime() +
tmp
......
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