版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。

...

代码块
languagejson
firstline1
linenumberstrue
{
    "fields": [{
        "key": "course_index",
        "options": {
            "onlyTc": false,
            "after_process": "=function(info) {if (info.response.data.success) {let file_name = info.response.data.file_name;let course_index = info.response.data.index;if(file_name){let file_format = file_name.split('.').pop();SCOPE.base_form.data.course_index = course_index + ',' + file_name;SCOPE.base_form.data.course_format = file_format;SCOPE.base_form.data.name = file_name;} else {SCOPE.base_form.data.course_index = course_index;let file = info.response.data.index_list[0];SCOPE.base_form.data.name = file.name;}}}",
            "uploadLocal": true,
            "custom_api": {
                "img_src": "/document/loadsourceimage?index=",
                "preview": "/document/loadsourcedocument/",
                "upload": "https://poctest.hcmcloud.cn/upload_video?app_id=qewiproeqw&app_secret=dsafrqewireowq",
                "download": "https://poctest.hcmcloud.cn/"
            }
        }
    }]
}


如果删除源文件:

代码块
languagejson
{
    "fields": [{
        "key": "course_index",
        "options": {
            "onlyTc": false,
            "after_process": "=function(info) {if (info.response.data.success) {let file_name = info.response.data.file_name;let course_index = info.response.data.index;if(file_name){let file_format = file_name.split('.').pop();SCOPE.base_form.data.course_index = course_index + ',' + file_name;SCOPE.base_form.data.course_format = file_format;SCOPE.base_form.data.name = file_name;} else {SCOPE.base_form.data.course_index = course_index;let file = info.response.data.index_list[0];SCOPE.base_form.data.name = file.name;}}}",
            "uploadLocal": true,
            "delete_source": true,
            "custom_api": {
                "img_src": "/document/loadsourceimage?index=",
                "preview": "/document/loadsourcedocument/",
                "upload": "https://poctest.hcmcloud.cn/upload_video?app_id=qewiproeqw&app_secret=dsafrqewireowq",
                "download": "https://poctest.hcmcloud.cn/",
                "delete": "https://poctest.hcmcloud.cn/upload_video/delete?app_id=qewiproeqw&app_secret=dsafrqewireowq"
            },
            "process_delete": "=function(file){return {index: file.file_id||file.index, file_type: file.file_type}}"
        }
    }]
}



信息
title注意

配置完成之后,只有mp4格式的视频文件才会上传到指定的视频服务器,其他类型以及格式的文件仍然是上传到cloud服务器.

...