我的AppID:jxAoTGx9FuLNOT1dmc46b78h-MdYXbMMI|
我的云函数:
const AV = require("leanengine");
const fs = require("fs");
const path = require("path");
/**
* Loads all cloud functions under the functions
directory.
*/
fs.readdirSync(path.join(__dirname, "functions")).forEach(file => {
require(path.join(__dirname, "functions", file));
});
/**
* A simple cloud function.
*/
AV.Cloud.define("hello", function (request) {
return "Hello world!";
});
AV.Cloud.define("easyfile", async request => {
try {
// const createdAt = req.query.created_at;
const query = new AV.Query("EasyFile");
// if (createdAt !== undefined) {
// query.greaterThan("createdAt", createdAt);
// }
const easyfileList = await query.find();
console.log(easyfileList);
return easyfileList;
} catch (error) {
console.error(error);
throw error;
}
});
我的错误:
Error: Forbidden [403 GET https://jxaotgx9.api.lncldglobal.com/1.1/classes/EasyFile]
at C:\Code\server\easylink.server\node_modules\leancloud-storage\dist\node\request.js:163:17
at tryCatch (C:\Code\server\easylink.server\node_modules\es6-promise\dist\es6-promise.js:410:12)
at invokeCallback (C:\Code\server\easylink.server\node_modules\es6-promise\dist\es6-promise.js:425:13)
at publish (C:\Code\server\easylink.server\node_modules\es6-promise\dist\es6-promise.js:399:7)
at publishRejection (C:\Code\server\easylink.server\node_modules\es6-promise\dist\es6-promise.js:340:3)
at flush (C:\Code\server\easylink.server\node_modules\es6-promise\dist\es6-promise.js:128:5)
at processTicksAndRejections (node:internal/process/task_queues:78:11) {
code: -1,
rawMessage: 'Forbidden'
}