mirror of
https://github.com/dqzboy/Docker-Proxy.git
synced 2026-01-17 10:32:57 +08:00
25 lines
637 B
JavaScript
25 lines
637 B
JavaScript
const MenuItem = require('../models/MenuItem');
|
|
|
|
async function initMenuItems() {
|
|
const count = await MenuItem.countDocuments();
|
|
if (count === 0) {
|
|
await MenuItem.insertMany([
|
|
{
|
|
text: '首页',
|
|
link: '/',
|
|
icon: 'fa-home',
|
|
order: 1
|
|
},
|
|
{
|
|
text: '文档',
|
|
link: '/docs',
|
|
icon: 'fa-book',
|
|
order: 2
|
|
}
|
|
// 添加更多默认菜单项...
|
|
]);
|
|
console.log('默认菜单项已初始化');
|
|
}
|
|
}
|
|
|
|
module.exports = initMenuItems; |