mirror of
https://github.com/casdoor/casdoor.git
synced 2025-05-23 10:45:47 +08:00
Fix termsOfUse upload in application edit page
This commit is contained in:
parent
3c871c38df
commit
e360b06d12
@ -21,6 +21,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"mime"
|
"mime"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/beego/beego/utils/pagination"
|
"github.com/beego/beego/utils/pagination"
|
||||||
"github.com/casdoor/casdoor/object"
|
"github.com/casdoor/casdoor/object"
|
||||||
@ -235,10 +236,10 @@ func (c *ApiController) UploadResource() {
|
|||||||
user.Avatar = fileUrl
|
user.Avatar = fileUrl
|
||||||
object.UpdateUser(user.GetId(), user, []string{"avatar"}, false)
|
object.UpdateUser(user.GetId(), user, []string{"avatar"}, false)
|
||||||
case "termsOfUse":
|
case "termsOfUse":
|
||||||
applicationId := fmt.Sprintf("admin/%s", parent)
|
_, applicationId := util.GetOwnerAndNameFromIdNoCheck(strings.TrimRight(fullFilePath, ".html"))
|
||||||
app := object.GetApplication(applicationId)
|
applicationObj := object.GetApplication(applicationId)
|
||||||
app.TermsOfUse = fileUrl
|
applicationObj.TermsOfUse = fileUrl
|
||||||
object.UpdateApplication(applicationId, app)
|
object.UpdateApplication(applicationId, applicationObj)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.ResponseOk(fileUrl, objectKey)
|
c.ResponseOk(fileUrl, objectKey)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user