作者 tangxvhui

bug 修复

... ... @@ -21,21 +21,6 @@ func init() {
if !constant.DISABLE_SQL_GENERATE_PRINT {
DB.AddQueryHook(SqlGeneratePrintHook{})
}
// if !constant.DISABLE_CREATE_TABLE {
// for _, model := range []interface{}{
// //(*models.Employee)(nil),
// (*models.PartnerInfo)(nil),
// } {
// err := DB.CreateTable(model, &orm.CreateTableOptions{
// Temp: false,
// IfNotExists: true,
// FKConstraints: true,
// })
// if err != nil {
// panic(err)
// }
// }
// }
}
type SqlGeneratePrintHook struct{}
... ...
... ... @@ -139,21 +139,17 @@ func (c *AdminLoginController) AdminpPofile() {
"id": v.Id,
"status": 0, //状态 1-启用 0-禁用,前端需要
}
permissionSlice = append(permissionSlice, m)
}
for index := range permissionSlice {
if adminuser.IsDefault {
permissionSlice[index]["status"] = 1
continue
}
for _, p := range adminuser.Permission {
if p == permissionSlice[index]["id"] {
permissionSlice[index]["status"] = 1
if p.Id == v.Id {
m["status"] = 1
break
}
if p == permissionSlice[index]["parentId"] {
permissionSlice[index]["status"] = 1
if p.Id == v.ParentId {
m["status"] = 1
break
}
}
permissionSlice = append(permissionSlice, m)
}
userData := map[string]string{
"id": fmt.Sprint(adminuser.Id),
... ...