Use url.QueryUnescape for xpath and method in process components
This commit is contained in:
parent
00b0649296
commit
c4e96366bf
6 changed files with 14 additions and 12 deletions
|
|
@ -2,6 +2,7 @@ package chart
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"github.com/yaoapp/gou/process"
|
"github.com/yaoapp/gou/process"
|
||||||
"github.com/yaoapp/kun/exception"
|
"github.com/yaoapp/kun/exception"
|
||||||
|
|
@ -33,8 +34,8 @@ func processComponent(process *process.Process) interface{} {
|
||||||
|
|
||||||
process.ValidateArgNums(3)
|
process.ValidateArgNums(3)
|
||||||
chart := MustGet(process)
|
chart := MustGet(process)
|
||||||
xpath := process.ArgsString(1)
|
xpath, _ := url.QueryUnescape(process.ArgsString(1))
|
||||||
method := process.ArgsString(2)
|
method, _ := url.QueryUnescape(process.ArgsString(2))
|
||||||
key := fmt.Sprintf("%s.$%s", xpath, method)
|
key := fmt.Sprintf("%s.$%s", xpath, method)
|
||||||
|
|
||||||
// get cloud props
|
// get cloud props
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package dashboard
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/url"
|
||||||
|
|
||||||
"github.com/yaoapp/gou/process"
|
"github.com/yaoapp/gou/process"
|
||||||
"github.com/yaoapp/kun/exception"
|
"github.com/yaoapp/kun/exception"
|
||||||
|
|
@ -33,8 +34,8 @@ func processComponent(process *process.Process) interface{} {
|
||||||
|
|
||||||
process.ValidateArgNums(3)
|
process.ValidateArgNums(3)
|
||||||
dashboard := MustGet(process)
|
dashboard := MustGet(process)
|
||||||
xpath := process.ArgsString(1)
|
xpath, _ := url.QueryUnescape(process.ArgsString(1))
|
||||||
method := process.ArgsString(2)
|
method, _ := url.QueryUnescape(process.ArgsString(2))
|
||||||
key := fmt.Sprintf("%s.$%s", xpath, method)
|
key := fmt.Sprintf("%s.$%s", xpath, method)
|
||||||
|
|
||||||
// get cloud props
|
// get cloud props
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ func exportAPI() error {
|
||||||
Path: "/:id/download/:field",
|
Path: "/:id/download/:field",
|
||||||
Method: "GET",
|
Method: "GET",
|
||||||
Process: "yao.list.Download",
|
Process: "yao.list.Download",
|
||||||
In: []interface{}{"$param.id", "$param.field", "$query.name", "$query.token"},
|
In: []interface{}{"$param.id", "$param.field", "$query.name", "$query.token", "$query.app"},
|
||||||
Out: api.Out{
|
Out: api.Out{
|
||||||
Status: 200,
|
Status: 200,
|
||||||
Body: "{{content}}",
|
Body: "{{content}}",
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ func (dsl *DSL) Xgen(data map[string]interface{}, excludes map[string]bool, quer
|
||||||
cProp.Query = newQuery.(map[string]interface{})
|
cProp.Query = newQuery.(map[string]interface{})
|
||||||
}
|
}
|
||||||
|
|
||||||
if cProp.Type == "Upload" {
|
if cProp.Type == "Upload" || cProp.Type == "WangEditor" {
|
||||||
return fmt.Sprintf("/api/__yao/list/%s%s", dsl.ID, cProp.UploadPath())
|
return fmt.Sprintf("/api/__yao/list/%s%s", dsl.ID, cProp.UploadPath())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,8 +40,8 @@ func processComponent(process *gouProcess.Process) interface{} {
|
||||||
|
|
||||||
process.ValidateArgNums(3)
|
process.ValidateArgNums(3)
|
||||||
list := MustGet(process)
|
list := MustGet(process)
|
||||||
xpath := process.ArgsString(1)
|
xpath, _ := url.QueryUnescape(process.ArgsString(1))
|
||||||
method := process.ArgsString(2)
|
method, _ := url.QueryUnescape(process.ArgsString(2))
|
||||||
key := fmt.Sprintf("%s.$%s", xpath, method)
|
key := fmt.Sprintf("%s.$%s", xpath, method)
|
||||||
|
|
||||||
// get cloud props
|
// get cloud props
|
||||||
|
|
@ -113,8 +113,8 @@ func processUpload(process *gouProcess.Process) interface{} {
|
||||||
|
|
||||||
process.ValidateArgNums(4)
|
process.ValidateArgNums(4)
|
||||||
list := MustGet(process)
|
list := MustGet(process)
|
||||||
xpath := process.ArgsString(1)
|
xpath, _ := url.QueryUnescape(process.ArgsString(1))
|
||||||
method := process.ArgsString(2)
|
method, _ := url.QueryUnescape(process.ArgsString(2))
|
||||||
key := fmt.Sprintf("%s.$%s", xpath, method)
|
key := fmt.Sprintf("%s.$%s", xpath, method)
|
||||||
|
|
||||||
// get cloud props
|
// get cloud props
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,8 @@ func processComponent(process *gouProcess.Process) interface{} {
|
||||||
|
|
||||||
process.ValidateArgNums(3)
|
process.ValidateArgNums(3)
|
||||||
tab := MustGet(process)
|
tab := MustGet(process)
|
||||||
xpath := process.ArgsString(1)
|
xpath, _ := url.QueryUnescape(process.ArgsString(1))
|
||||||
method := process.ArgsString(2)
|
method, _ := url.QueryUnescape(process.ArgsString(2))
|
||||||
key := fmt.Sprintf("%s.$%s", xpath, method)
|
key := fmt.Sprintf("%s.$%s", xpath, method)
|
||||||
|
|
||||||
// get cloud props
|
// get cloud props
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue