d2-projects / d2-admin-xiya-go-cms Goto Github PK
View Code? Open in Web Editor NEWcms by d2-admin
License: MIT License
cms by d2-admin
License: MIT License
之前有个项目用了这个框架,配置式的列表管理和权限控制做的很不错的,现在发现项目快1年没有更新了,示例也打不开了(似乎是数据服务停了),想请问是项目停止维护了吗?如果停了是为什么?
我最近参考你的项目也做了一个权限控制的前端,但是在加载侧边栏和多标签栏时,出现了不联动和侧边栏不激活的BUG,我想看下是我的权限格式设置错误还是d2admin的BUG
VUE_APP_API_1_TEST=https://api.cms.xiya.vip
VUE_APP_API_0_DEV=http://127.0.0.1:8888
修改后无效,还是默认激活https://api.cms.xiya.vip
api 地址设置了不生效
VUE_APP_API_0_TEST=http://192.168.31.179:3913
用 d2Admin 的带路由参数缓存方法,给页面加了 cache 之后,打开多个页面时,只加载第一页面打开的数据。之后打开的页面的 props 的 id 参数可以获取到实时的,但是新开页面初始化的请求就不会发送了,直接加载了第一个页面的内容。
请问这个是什么问题?
谢谢
开发过程中,同事创建了新的菜单页面,而我本地没有他新创建的页面文件,导致了页面空白。
d2-admin-xiya-go-cms/src/store/modules/d2admin/modules/permission.js
Lines 100 to 115 in e629340
修复:
try {
let route = {
path: sourceItem.route_path,
name: sourceItem.route_name,
meta: {
title: sourceItem.menu_name,
auth: true,
cache: sourceItem.route_cache === context.env.VUE_APP_DICT_IS_TRUE
},
component: utils.import(sourceItem.route_component)
}
routes.push(route)
// 为动态注册的路由可以正常在演示环境上显示源码链接而设置,如果不需要显示源码的功能,请移除此属性
// https://github.com/d2-projects/vue-filename-injector 只处理 .vue 类型的文件 所以需要在路由上设置源码路径信息
if (context.env.VUE_APP_SCOURCE_LINK === 'TRUE') {
route.meta.source = 'src/views/' + sourceItem.route_component + (/(.js|.vue)$/.test(sourceItem.route_component) ? '' : '/index.js')
}
routes.push(route)
} catch (err) {
utils.log.capsule('菜单', '文件不存在', 'danger')
utils.log.danger(err.message)
}
d2-admin-xiya-go-cms/src/store/modules/d2admin/modules/permission.js
Lines 64 to 78 in c0e1d4e
这个函数会把非按钮菜单都识别为合法路由,导致路由加载失败。如以下菜单将返回 true
isEffectiveRoute({
menu_name: '财务管理',
menu_type: 1
})
修改成这样就可以了
function isEffectiveRoute (sourceItem) {
if (sourceItem.menu_type !== env.VUE_APP_DICT_MENU_TYPE_MENU) return
const allRequiredProperties = [
'menu_name',
'route_name',
'route_path',
'route_component'
]
let has = true
const keyArr = Object.keys(sourceItem)
allRequiredProperties.some(item => {
if (!keyArr.includes(item)) {
has = false
return true
}
})
if (!has) return
return true
}
🌈 显示优化 | 谷歌浏览器-列设置显示有问题
所有菜单,点击列设置 ->弹框不显示内容
d2-tree-popover
组件 cancle 之后重置 d2-tree
getSourceFlat
方法需要过滤 children_list
字段
为了统一格式,请将下面一行复制到 `Title` 栏,然后删除这部分
🖐 其它问题 | 你的标题
如果需要,在这里描述具体内容
store/modules/d2admin/modules/permission.js 第104行添加以下代码解决
cache: sourceItem.route_cache === context.env.VUE_APP_DICT_IS_TRUE
为了统一格式,请将下面一行复制到 `Title` 栏,然后删除这部分
🤔 提问 | 你的标题
如果需要,在这里描述具体内容
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.