HWH5.openFile
HWH5.deleteFile
HWH5.encryptFile


HWH5.openFile

支持版本>=10.0.5

扫码体验:

vscode-plugin

传入文件地址,打开文档

请求参数

参数 类型 必填 说明
filePath String 本地文档URL

返回结果

参数 说明
status 成功:1 ,失败 0

请求示例

  • ES6版本

    HWH5.openFile({ filePath: 'download/mdm_text.xlsx' }).then(data => {
      console.log(data);
    }).catch(error => {
      console.log('打开文档失败', error);
    });
    
  • ES5版本

    HWH5.openFile({ filePath: 'download/mdm_text.xlsx' }).then(function (data) {
      console.log(data);
    }).catch(function (error) {
      console.log('打开文档失败', error);
    });
    

HWH5.removeFile

支持版本>=10.0.5

扫码体验:

vscode-plugin

根据相对或绝对路径删除文件(只删除当前We码小程序下的文件)

请求参数

参数 类型 必填 说明
path String 必填 要删除文件的路径

返回说明

参数 说明
status 成功:1.

请求示例

  • ES6版本
  •   HWH5.removeFile({
        path: './download/test.png'
      }).then(data => {
        console.log(data);
      }).catch(error => {
        console.log('删除文件失败', error);
      });
    
  • ES5版本
  •   HWH5.removeFile({
        path: './download/test.png'
      }).then(function (data) {
        console.log(data);
      }).catch(function (error) {
        console.log('删除文件失败', error);
      });
    

    HWH5.encryptFile

    支持版本>=10.0.5

    加密文档,可对文档进行加密处理,只支持Android

    请求参数

    参数 类型 必填 说明
    filePath String 必传,本地文档URL

    返回说明

    参数 说明
    filePath 加密后的路径

    请求示例

    • ES6版本
      HWH5.encryptFile({ filePath: 'download/mdm_text.xlsx' }).then(data => {
        console.log(data);
      }).catch(error => {
        console.log('加密失败', error);
      });
    
    • ES5版本
      HWH5.encryptFile({ filePath: 'download/mdm_text.xlsx' }).then(function (data) {
        console.log(data);
      }).catch(function (error) {
        console.log('加密失败', error);
      });
    

    结果。 ""

      无结果。 ""