codecamp
QQ小程序 Cloud

方法

Cloud.init()

初始化 SDK 实例

Cloud.callFunction(object: Object): Promise<Object>

调用云函数

Cloud.database(options: Object): Database

获取数据库实例

Cloud.deleteFile(fileList: string[]): Promise<Object>

从云存储空间删除文件,一次最多 50 个

Cloud.downloadFile()

从云存储空间下载文件

Cloud.getTempFileURL(fileList: string[]): Promise<Object>

用云文件 ID 换取真实链接,公有读的文件获取的链接不会过期,私有的文件获取的链接十分钟有效期。一次最多取 50 个。

Cloud.uploadFile()

将本地资源上传至云存储空间,如果上传至同一路径则是覆盖

QQ小程序 图像标签
QQ小程序 qq.cloud.init
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

QQ小程序 开发

硬件能力

QQ小程序 云开发

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }