Merge pull request #264 from trheyi/main
[change] upload process return value
This commit is contained in:
commit
db341092b2
2 changed files with 14 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ package form
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/yaoapp/gou"
|
||||
|
|
@ -135,6 +136,12 @@ func processUpload(process *gou.Process) interface{} {
|
|||
exception.New(err.Error(), 500).Throw()
|
||||
}
|
||||
|
||||
if file, ok := res.(string); ok {
|
||||
field := strings.TrimSuffix(xpath, ".edit.props")
|
||||
file = fmt.Sprintf("/api/__yao/form/%s/download/%s?name=%s", form.ID, url.QueryEscape(field), file)
|
||||
return file
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import (
|
|||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
|
@ -122,6 +123,12 @@ func processUpload(process *gou.Process) interface{} {
|
|||
exception.New(err.Error(), 500).Throw()
|
||||
}
|
||||
|
||||
if file, ok := res.(string); ok {
|
||||
field := strings.TrimSuffix(xpath, ".edit.props")
|
||||
file = fmt.Sprintf("/api/__yao/table/%s/download/%s?name=%s", tab.ID, url.QueryEscape(field), file)
|
||||
return file
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue