SliverHorn
4 years ago
13 changed files with 79 additions and 13 deletions
-
10server/cmd/datas/AuthorityMenu.go
-
5server/cmd/datas/apis.go
-
5server/cmd/datas/authorities.go
-
5server/cmd/datas/authority_Ids.go
-
5server/cmd/datas/authority_menus.go
-
5server/cmd/datas/casbins.go
-
5server/cmd/datas/customers.go
-
20server/cmd/datas/dictionaries.go
-
5server/cmd/datas/dictionary_details.go
-
5server/cmd/datas/files.go
-
5server/cmd/datas/menus.go
-
5server/cmd/datas/users.go
-
2server/cmd/gva/version.go
@ -1,7 +1,13 @@ |
|||||
package datas |
package datas |
||||
|
|
||||
import "gorm.io/gorm" |
|
||||
|
import ( |
||||
|
"github.com/gookit/color" |
||||
|
"gorm.io/gorm" |
||||
|
) |
||||
|
|
||||
func InitAuthorityMenu(db *gorm.DB) (err error) { |
func InitAuthorityMenu(db *gorm.DB) (err error) { |
||||
return db.Exec("CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `authority_menu` AS select `sys_base_menus`.`id` AS `id`,`sys_base_menus`.`created_at` AS `created_at`, `sys_base_menus`.`updated_at` AS `updated_at`, `sys_base_menus`.`deleted_at` AS `deleted_at`, `sys_base_menus`.`menu_level` AS `menu_level`,`sys_base_menus`.`parent_id` AS `parent_id`,`sys_base_menus`.`path` AS `path`,`sys_base_menus`.`name` AS `name`,`sys_base_menus`.`hidden` AS `hidden`,`sys_base_menus`.`component` AS `component`, `sys_base_menus`.`title` AS `title`,`sys_base_menus`.`icon` AS `icon`,`sys_base_menus`.`sort` AS `sort`,`sys_authority_menus`.`sys_authority_authority_id` AS `authority_id`,`sys_authority_menus`.`sys_base_menu_id` AS `menu_id`,`sys_base_menus`.`keep_alive` AS `keep_alive`,`sys_base_menus`.`default_menu` AS `default_menu` from (`sys_authority_menus` join `sys_base_menus` on ((`sys_authority_menus`.`sys_base_menu_id` = `sys_base_menus`.`id`)))").Error |
|
||||
|
if err := db.Exec("CREATE ALGORITHM = UNDEFINED SQL SECURITY DEFINER VIEW `authority_menu` AS select `sys_base_menus`.`id` AS `id`,`sys_base_menus`.`created_at` AS `created_at`, `sys_base_menus`.`updated_at` AS `updated_at`, `sys_base_menus`.`deleted_at` AS `deleted_at`, `sys_base_menus`.`menu_level` AS `menu_level`,`sys_base_menus`.`parent_id` AS `parent_id`,`sys_base_menus`.`path` AS `path`,`sys_base_menus`.`name` AS `name`,`sys_base_menus`.`hidden` AS `hidden`,`sys_base_menus`.`component` AS `component`, `sys_base_menus`.`title` AS `title`,`sys_base_menus`.`icon` AS `icon`,`sys_base_menus`.`sort` AS `sort`,`sys_authority_menus`.`sys_authority_authority_id` AS `authority_id`,`sys_authority_menus`.`sys_base_menu_id` AS `menu_id`,`sys_base_menus`.`keep_alive` AS `keep_alive`,`sys_base_menus`.`default_menu` AS `default_menu` from (`sys_authority_menus` join `sys_base_menus` on ((`sys_authority_menus`.`sys_base_menu_id` = `sys_base_menus`.`id`)))").Error; err != nil { |
||||
|
color.Danger.Println("authority_menu视图已存在!") |
||||
|
} |
||||
|
return nil |
||||
} |
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue