提交 80120834 编写于 作者: R rikugun

fix: 获取菜单失败的错误

上级 9b659daf
......@@ -18,7 +18,11 @@ mysql:
max-idle-conns: 10
max-open-conns: 10
log-mode: true
#sqlite 配置
sqlite:
path: db/db.db
log-mode: true
config: 'loc=Asia/Shanghai'
# oss configuration
qiniu:
access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ'
......@@ -35,6 +39,7 @@ system:
use-multipoint: false
env: 'public' # Change to "develop" to skip authentication for development mode
addr: 8888
db: sqlite
# captcha configuration
captcha:
......
......@@ -14,7 +14,7 @@ import (
// @return err error
// @return menus []model.SysMenu
func GetMenuTree(authorityId string) (err error, menus []model.SysMenu) {
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ? AND authority_menu.parent_id = ?"
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM sys_menus authority_menu WHERE authority_menu.authority_id = ? AND authority_menu.parent_id = ?"
err = global.GVA_DB.Raw(sql, authorityId, 0).Scan(&menus).Error
for i := 0; i < len(menus); i++ {
......@@ -119,7 +119,7 @@ func AddMenuAuthority(menus []model.SysBaseMenu, authorityId string) (err error)
// @return err error
// @return menus []SysBaseMenu
func GetMenuAuthority(authorityId string) (err error, menus []model.SysMenu) {
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM authority_menu WHERE authority_menu.authority_id = ?"
sql := "SELECT authority_menu.created_at,authority_menu.updated_at,authority_menu.deleted_at,authority_menu.menu_level,authority_menu.parent_id,authority_menu.path,authority_menu.`name`,authority_menu.hidden,authority_menu.component,authority_menu.title,authority_menu.icon,authority_menu.sort,authority_menu.menu_id,authority_menu.authority_id FROM sys_menus authority_menu WHERE authority_menu.authority_id = ?"
err = global.GVA_DB.Raw(sql, authorityId).Scan(&menus).Error
return err, menus
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册