UpSystemModule 系统基础模块

模块概述

使用系统的一些基础功能


方法列表

  • setClipboard (设置剪贴板内容)
  • getClipboard(获取剪贴板内容)
  • setScreenSecure (设置是否禁止截屏)
  • setNebulaTitleBar (设置 Nebula 容器的原生标题栏)
  • createDesktopShortcut (设置桌面快捷方式)
  • preventAutomaticLockScreen (防止自动锁屏)

公共数据

  • 所有数据均以JSON结构返回,由代码,信息和数据三部分组成
    {
      "retCode": "000000", //接口状态标识码
      "retInfo": "操作成功",//接口信息说明
      "retData": null //业务数据
    }
    

具体定义:返回数据通用

方法说明

  • setClipboard (设置剪贴板内容)

    setClipboard()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:
属性名 数据类型 是否必填 说明
value String 设置内容
错误返回 retCode说明:
retCode编码 retInfo说明

使用通用retCode

示例

调用方式

uplusapi.setClipboard({
  value: '这是设置的粘贴板内容'
}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
  "retCode": "000000",
  "retInfo": "调用函数setClipboardForAction成功",
  "retData": ""
}
  • getClipboard (获取剪贴板内容)

    getClipboard()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:

错误返回 retCode说明:
retCode编码 retInfo说明

使用通用retCode

正确返回 retData说明:
正确返回 retData说明:
属性名 数据类型 说明
value String 从剪贴板获取到的内容
示例

调用方式

uplusapi.getClipboard().then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
  "retCode": "000000",
  "retData": {
    "value": "这是设置的粘贴板内容"
  },
  "retInfo": "调用函数getClipboardForAction成功"
}
  • setScreenSecure 设置是否禁止截屏(只支持Android)

    setScreenSecure()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:
属性名 数据类型 说明
secure Boolean true: 禁止截屏 false:无限制
错误返回 retCode说明:
retCode编码 retInfo说明

使用通用retCode

正确返回 retData说明:
正确返回 retData说明:
属性名 数据类型 说明

使用通用retCode

示例

调用方式

uplusapi.setScreenSecure({secure: true}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
  "retCode": "000000",
  "retData": "",
  "retInfo": "调用函数setScreenSecureForAction成功"
}
  • setNebulaTitleBar (设置nebula容器的原生标题栏)

    setNebulaTitleBar()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:
属性名 数据类型 是否必填 说明
show String 是否开启nebula容器的原生标题栏: 'true' - 开启原生标题栏 , 'false' - 关闭原生标题栏
title String 原生标题栏的展示标题文案,在show为true下,可以传入此参数;当show为true,开启原生标题栏,未传入title参数时,读取当前页面标签title内文案展示;若此时无title标签或者title标签内为空,则原生标题栏文案展示为空
错误返回 retCode说明:
retCode编码 retInfo说明

使用通用retCode

正确返回 retData说明

使用通用retCode

示例

调用方式

uplusapi.upSystemModule.setNebulaTitlebar({
  show: 'true',
  title: '我的页面'
}).then(res => console.log(res)).catch(err => console.log(err));

成功返回结果

{
  "retCode": "000000",
  "retData": "",
  "retInfo": "调用函数setNebulaTitleBar成功"
}
  • createDesktopShortcut (设置桌面快捷方式)

    createDesktopShortcut()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:
属性名 数据类型 是否必填 说明
image String 创建的快捷方式的图标
name String 创建的快捷方式的名称
needCheckUser String 账号切换检测
showConer String 创建的快捷方式的图标圆角
id String 是(仅限安卓) 创建的快捷方式的id(安卓必填,iOS不是必填项)
describe String 创建的快捷方式的描述
detailUrl String 创建的快捷方式的跳转链接
traceCancelCode Number 取消创建的点位
traceAddCode Number 添加快捷方式的点位
traceHelpCode Number 点击帮助的点位
traceClickCode Number 快捷方式点击打开的打点
traceAttributes Map 打点需要的传参
错误返回 retCode说明:
retCode编码 retInfo说明
000001 执行失败
000002 参数无效
正确返回 retData说明:
正确返回 retData说明:
retCode编码 retInfo说明
000000 操作成功
示例

调用方式

uplusapi.upSystemModule.createDesktopShortcut({
  enable: true
}).then(res => console.log(res)).catch(err => console.log(err));

获取成功返回结果

{
  "retCode": "000000",
  "retData": "",
  "retInfo": "调用函数createDesktopShortcutForAction成功"
}
  • preventAutomaticLockScreen 防止息屏

    preventAutomaticLockScreen()
适用性
容器 Nebula
支持情况
APP版本 待确认
params 输入参数:
属性名 数据类型 是否必填 说明
prevent Boolean true: 禁止息屏 false:允许息屏。 默认:false。
错误返回 retCode说明:
retCode编码 retInfo说明

使用通用retCode

正确返回 retData说明

使用通用retCode

示例

调用方式

uplusapi.upSystemModule.preventAutomaticLockScreen({prevent: true}).then(res => console.log(res)).catch(err => console.log(err));

成功返回结果

{
  "retCode": "000000",
  "retData": "",
  "retInfo": "调用函数preventLockScreenForAction成功"
}

results matching ""

    No results matching ""