Skip to content

Commit

Permalink
fix: chinese url encode bug
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeEirc committed Nov 19, 2020
1 parent f6e2049 commit d81378b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions pkg/service/perm_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ func GetUserApplicationSystemUsers(userId, appId string) (res []model.SystemUser
return
}

func ValidateUserApplicationPermission(userId, appId, systemUserId string) bool{
func ValidateUserApplicationPermission(userId, appId, systemUserId string) bool {
payload := map[string]string{
"user_id": userId,
"user_id": userId,
"application_id": appId,
"system_user_id": systemUserId,
"system_user_id": systemUserId,
}
Url := ValidateApplicationPermissionURL
var res struct {
Expand All @@ -75,11 +75,11 @@ func ValidateUserApplicationPermission(userId, appId, systemUserId string) bool{
return res.Msg
}

func GetApplicationSystemUserAuthInfo(systemUserId string) (info model.SystemUserAuthInfo){
func GetApplicationSystemUserAuthInfo(systemUserId string) (info model.SystemUserAuthInfo) {
Url := fmt.Sprintf(SystemUserAuthURL, systemUserId)
_, err := authClient.Get(Url, &info)
if err != nil {
logger.Errorf("Get system user %s auth info failed", systemUserId)
}
return
}
}
4 changes: 2 additions & 2 deletions pkg/service/perm_asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package service

import (
"fmt"
"net/url"
"strconv"
"strings"

"github.com/jumpserver/koko/pkg/logger"
"github.com/jumpserver/koko/pkg/model"
Expand Down Expand Up @@ -32,7 +32,7 @@ func getPaginationResult(reqUrl string, param model.PaginationParam) (resp model
paramsArray := make([]map[string]string, 0, len(param.Searches)+2)
for i := 0; i < len(param.Searches); i++ {
paramsArray = append(paramsArray, map[string]string{
"search": url.QueryEscape(param.Searches[i]),
"search": strings.TrimSpace(param.Searches[i]),
})
}

Expand Down

0 comments on commit d81378b

Please sign in to comment.