Paooofuu/miniprogram/app.js

20 lines
586 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// app.js
App({
onLaunch: function () {
this.globalData = {
// env 参数说明:
// env 参数决定接下来小程序发起的云开发调用wx.cloud.xxx会请求到哪个云环境的资源
// 此处请填入环境 ID, 环境 ID 可在微信开发者工具右上顶部工具栏点击云开发按钮打开获取
env: "",
};
if (!wx.cloud) {
console.error("请使用 2.2.3 或以上的基础库以使用云能力");
} else {
wx.cloud.init({
env: this.globalData.env,
traceUser: true,
});
}
},
});