MiniX自绘渲染跨平台框架
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 框架说明
  • 声明式开发范式
  • 内置Api
指南
接口
  • Minix CLI
示例
  • 类Web框架

    • 框架说明
    • 类Web开发范式
    • 内置Api
  • 指南
  • 组件
  • 接口
  • 示例
  • 规范
  • DophinHybrid

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • DolphinWeex

    • 快速上手 (opens new window)
    • UI 组件库 (opens new window)
    • jsBridge 接口 (opens new window)
  • 发布消息
  • 常见问题
  • 更新日志
  • 快速上手
  • Basic 基础

  • Account

  • UI 界面

  • Device 设备

  • Bluetooth 蓝牙

  • Wifi WiFi

  • HomeManage 家庭管理

  • RoomManage 房间管理

  • Media 媒体

  • Location 定位

  • Encryption 加/解密

  • FileStorage 文件/存储

  • Http 网络/请求

    • uploadFile http文件上传
      • downloadFile http 文件下载
      • requestDataTransmit 服务透传接口
      • sendCentralCloudRequest 发送给中台的通用网络请求接口
      • uploadLocalFile 通用上传本地文件
      • uploadFileToOss 上传文件到阿里 oss
      • resetCookie
      • sendElectronicRequest
      • sendMCloudRequest
    • weather 天气信息

    • Siri

    • TelPhone

    请扫码查看示例

    # uploadFile ^6.8

    http 文件上传

    # 请求参数

    Prop Type Value Comment
    url String - 服务器地址
    filePath Object - 要上传文件资源的路径 (本地相对路径)
    name Number - 文件对应的 key
    header Number - HTTP 请求的 Header,Header 中不能设置 Referer
    formData Number - HTTP 请求中其他额外的 form data
    timeout Number - 超时时间,单位为毫秒

    # 引入接口模块

    import bridge from '@minix-iot/etsbridge-sdk'
    
    1

    # 参数代码示例

    let params = {
      url: 'https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3105753044,45676271&fm=26&gp=0.jpg',
      filePath: 'downFiles/timg.jpeg',
      name: 'keyname',
      header: {},
      formData: {}, //HTTP 请求中其他额外的 form data
      timeout: 10000,
    }
    
    1
    2
    3
    4
    5
    6
    7
    8

    # 接口调用示例

    let params = {
      url: this.url,
      filePath: this.filePath,
      name: this.name,
      header: this.header,
      formData: this.formData,
      timeout: this.timeout,
    }
    bridge
      .uploadFile(params)
      .then((res) => {
        console.log(res)
      })
      .catch((err) => {
        console.log(err)
      })
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    # 返回参数

    • 成功时返回
    Prop Type Comment
    code Number -
    msg String -

    # 返回示例

    
    {
        "code": 0,
        "msg": "success"
    }
    
    
    1
    2
    3
    4
    5
    6