??
https://forum.casbin.com/edit/topic/1311
image can not upload !.
无法使用媒体库功能。
测试验证,发现,腾讯云对象存储,可以正常上传到存储筒中,但是 casdoor-go-sdk 代码存在 bug
https://github.com/casdoor/casdoor-go-sdk/blob/master/casdoorsdk/resource.go
这段代码有问题,没有正确获得 fileUrl
不知道这个函数调用的具体的腾讯云对象存储的 url 是多少。
官方文档参考:
https://cloud.tencent.com/document/product/436/14690
总之返回值 resp 的解析 有问题。
func (c *Client) UploadResource (user string, tag string, parent string, fullFilePath string, fileBytes [] byte) (string, string, error) {
queryMap := map [string] string {
"owner": c.OrganizationName,
"user": user,
"application": c.ApplicationName,
"tag": tag,
"parent": parent,
"fullFilePath": fullFilePath,
}
resp, err := c.DoPost ("upload-resource", queryMap, fileBytes, true, true)
if err != nil {
return "", "", err
}
fileUrl := resp.Data.(string)
name := resp.Data2.(string)
return fileUrl, name, nil
}