|
|
|
@ -683,16 +683,12 @@ StaticParams.closePopModal = (com) => {
|
|
|
|
|
* insert:是否调插入资源表接口 默认true
|
|
|
|
|
* */
|
|
|
|
|
StaticParams.uploadFile = (file, callback = null,insert = true) => {
|
|
|
|
|
console.log("file:",file)
|
|
|
|
|
console.log("callback:",callback)
|
|
|
|
|
console.log("insert:",insert)
|
|
|
|
|
let split = file.name.split('.');
|
|
|
|
|
let guid = GUID_UUID.guid();
|
|
|
|
|
let key = BaseConfig.url_path_suffix + guid.substring(0, 2) + "/" + guid + "." + split[1]
|
|
|
|
|
let fd = new FormData();
|
|
|
|
|
fd.append('name', file.name)
|
|
|
|
|
fd.append('key', key)
|
|
|
|
|
|
|
|
|
|
if (BaseConfig.pt_type === "1") {
|
|
|
|
|
InterfaceConfig.callInterface([{ url: "uploadres/getSignatureInfo", method: "get", params: {}, isTestLogin: true }], (result) => {
|
|
|
|
|
if (result[0].success || result[0].status === 200) {
|
|
|
|
@ -717,10 +713,10 @@ StaticParams.uploadFile = (file, callback = null,insert = true) => {
|
|
|
|
|
},
|
|
|
|
|
}).then((rsp) => {
|
|
|
|
|
//rsp云上传这里传的值和局上传不一样
|
|
|
|
|
console.log("insert111:",insert)
|
|
|
|
|
if(insert === true){
|
|
|
|
|
StaticParams.insertResource(rsp, file, guid, split[0], split[1], callback)
|
|
|
|
|
}else {
|
|
|
|
|
rsp.data = {url:key}
|
|
|
|
|
callback({ success: true, data: rsp })
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|