应用构建文件下载

应用构建附件上传后单据中保存的是fileId,下面提供通过fileId获取附件和图片path的方案。

一、根据fileId获取附件地址

    let token = JSON.parse(AppContext()).token;
    //附件的fileid
    let attach = "222657c0-f13d-11ec-a76b-f548dc46aa54";
    let url = `https://yonbip.diwork.com/iuap-apcom-file/rest/v1/file/mdf/${attach}/files?includeChild=false&ts=1655781730750&pageSize=10`;
    let header = {"Content-Type": "application/json;charset=UTF-8","cookie": `yht_access_token=${token}`};
    let body ={};
    let apiResponse = postman("get", url,JSON.stringify(header),JSON.stringify(body));

二、根据fileId获取图片地址

    let token = JSON.parse(AppContext()).token;
    let url = `https://yonbip.diwork.com/iuap-apcom-file/rest/v1/file/batchFiles`;
    let header = {"Content-Type": "application/json;charset=UTF-8","cookie": `yht_access_token=${token}`};
    let attaches = [
        {
          businessId:"d8ad1d00-0644-11ed-bbf8-5f16f51b6cce",    //图片fileid
          objectName:"caep"
        }
      ]
    let body ={
      includeChild:false,
      pageSize:10,
      batchFiles:JSON.stringify(attaches)
    };
    let apiResponse = postman("post", url,JSON.stringify(header),JSON.stringify(body));
Copyright © 用友 -【生态技术部】 2021 all right reserved,powered by Gitbook修订时间: 2022-07-18 17:22:32

results matching ""

    No results matching ""