修复几处bug
This commit is contained in:
georgehao
2021-05-18 00:31:24 +08:00
parent 78efeef490
commit 5fbc2bbe6e
16 changed files with 73 additions and 38 deletions

View File

@@ -67,8 +67,7 @@ func (self *BaseController) Auth() {
if userId > 0 {
user, err := models.AdminGetById(userId)
//if err == nil && password == libs.Md5([]byte(self.getClientIp()+"|"+user.Password+user.Salt)) {
if err == nil && password == libs.Md5([]byte(user.Password+user.Salt)){
if err == nil && password == libs.Md5([]byte(self.getClientIp()+"|"+user.Password+user.Salt)) {
self.userId = user.Id
self.loginName = user.LoginName
self.userName = user.RealName
@@ -78,7 +77,7 @@ func (self *BaseController) Auth() {
}
isHasAuth := strings.Contains(self.allowUrl, self.controllerName+"/"+self.actionName)
noAuth := "ajaxsave/table/loginin/loginout/getnodes/startapitask/apistart/apipause"
noAuth := "ajaxsave/table/loginin/loginout/getnodes/start/apitask/apistart/apipause"
isNoAuth := strings.Contains(noAuth, self.actionName)
if isHasAuth == false && isNoAuth == false {