info
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
const db = uniCloud.database();
|
||||
|
||||
module.exports = {
|
||||
_before: function () { // 通用预处理器
|
||||
|
||||
},
|
||||
async getTags() {
|
||||
|
||||
try {
|
||||
const res = await db.collection("uni-cms-categories").get();
|
||||
// console.log();
|
||||
let tags = [];
|
||||
for (let i = 0 ; i < res.data.length; i++ ) {
|
||||
tags.push({
|
||||
text: res.data[i].name,
|
||||
value: res.data[i]._id
|
||||
});
|
||||
}
|
||||
return {
|
||||
"code": "200",
|
||||
"tags": tags
|
||||
};
|
||||
} catch(e) {
|
||||
return {
|
||||
"code": '500',
|
||||
"msg": e.message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "uni-cms-categories",
|
||||
"dependencies": {},
|
||||
"extensions": {
|
||||
"uni-cloud-jql": {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user