87,994
社区成员
发帖
与我相关
我的任务
分享
<html>有<script src="cloud.js"></script><html>
main.js 有:Vue.prototype.$cloud = window.cloud;
let that = this
console.log(that.$cloud)
let first = function(callback) {
var c1 = new that.$cloud.Cloud({
//必填,表示是未登录模式
identityless: true,
//资源方 AppID
resourceAppid: 'wx6dd573f6a3d2a21e',
//资源方环境 ID
resourceEnv: 'cloud1-6gfn91m92fea1015',
})
c1.init()
//回调
callback(c1)
};
//完成初始化后再回调,即可访问云数据库
let callback = function(c1) {
// 我个人不喜欢写云函数,所以直接写在Web这里做操作
// 你要访问的各种操作写在这个callback函数里即可,这里以查询users表为例
const db = c1.database();
db.collection('users').get({
success: res => {
console.log(res.data);
},
fail: res => {
console.log(res);
}
})
};
first(callback);
}
报:Cloud is not defined,求大神指教!
项目部署以后你怎么解决跨域的,想请问
已解决!
报的是:cannot read properpies of undefined.(reading Cloud)