diff --git a/conf/app.conf b/conf/app.conf index e5b3d43..1e749e1 100644 --- a/conf/app.conf +++ b/conf/app.conf @@ -17,7 +17,7 @@ notify.type = 0 # 数据库配置 db.host = 127.0.0.1 db.user = root -db.password = "12345678" +db.password = "123456" db.port = 3306 db.name = ppgo_job2 db.prefix = pp_ diff --git a/controllers/role.go b/controllers/role.go index c707ada..2d9ef45 100644 --- a/controllers/role.go +++ b/controllers/role.go @@ -12,8 +12,6 @@ import ( "strings" "time" - "fmt" - "github.com/astaxie/beego" "github.com/george518/PPGo_Job/models" ) @@ -89,7 +87,6 @@ func (self *RoleController) AjaxSave() { role.UpdateTime = time.Now().Unix() role.Status = 1 - fmt.Println("=========", role) auths := strings.TrimSpace(self.GetString("nodes_data")) role_id, _ := self.GetInt("id") if role_id == 0 { diff --git a/models/role_auth.go b/models/role_auth.go index 1a2b4e8..4a91392 100644 --- a/models/role_auth.go +++ b/models/role_auth.go @@ -43,7 +43,9 @@ func RoleAuthGetById(id int) ([]*RoleAuth, error) { } func RoleAuthDelete(id int) (int64, error) { - return orm.NewOrm().Delete(&RoleAuth{RoleId: int64(id)}) + _, err := orm.NewOrm().Raw("DELETE FROM `pp_uc_role_auth` WHERE `role_id` = ?", + strconv.Itoa(id)).Exec() + return 0, err } //获取多个