作者 yangfu

修改 1.vod视频权限获取修改

@@ -40,4 +40,7 @@ user_center_app_secret ="cykbjnfqgctn" @@ -40,4 +40,7 @@ user_center_app_secret ="cykbjnfqgctn"
40 h5_host = "http://mmm-web-open-test.fjmaimaimai.com" 40 h5_host = "http://mmm-web-open-test.fjmaimaimai.com"
41 41
42 #审核中心 42 #审核中心
43 -suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com"  
  43 +suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com"
  44 +
  45 +#阿里云
  46 +cname ="https://media.goexample.live/"
@@ -43,3 +43,5 @@ h5_host = "http://mmm-web-open-test.fjmaimaimai.com" @@ -43,3 +43,5 @@ h5_host = "http://mmm-web-open-test.fjmaimaimai.com"
43 #审核中心 43 #审核中心
44 suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com" 44 suplus_approve_host ="http://suplus-approve-dev.fjmaimaimai.com"
45 45
  46 +#阿里云
  47 +cname ="https://media.goexample.live/"
@@ -159,7 +159,17 @@ func MetricCounter(ctx *context.Context) { @@ -159,7 +159,17 @@ func MetricCounter(ctx *context.Context) {
159 }).Inc() 159 }).Inc()
160 } 160 }
161 161
162 -//检查签名 162 +/*检查签名
  163 +app 传入 Sign TimeStamp Uuid AccessToken
  164 +
  165 +Sign=》客户端签名串
  166 +TimeStamp=》时间戳
  167 +UUID字符串=》Uuid(36位)/AccessToken(32位)
  168 +
  169 +//生成签名串与客户端生成的签名串比较
  170 +sign="v!(MmM"+TimeStamp + Uuid + AccessToken+"MmM)i^"
  171 +signHex = hex.EncodeToString(sha256(sign))
  172 +*/
163 func CheckSign(ctx *context.Context) (result bool) { 173 func CheckSign(ctx *context.Context) (result bool) {
164 var ( 174 var (
165 h *protocol.RequestHeader 175 h *protocol.RequestHeader
@@ -10,7 +10,7 @@ type CreateUploadImageResponse struct { @@ -10,7 +10,7 @@ type CreateUploadImageResponse struct {
10 ImageURL string `json:"imageURL"` 10 ImageURL string `json:"imageURL"`
11 UploadAddress string `json:"uploadAddress"` 11 UploadAddress string `json:"uploadAddress"`
12 UploadAuth string `json:"uploadAuth"` 12 UploadAuth string `json:"uploadAuth"`
13 - FileURL string `json:"fileURL"` 13 + FileURL string `json:"-"` //fileURL
14 } 14 }
15 15
16 type CreateUploadImagesRequest struct { 16 type CreateUploadImagesRequest struct {
@@ -64,7 +64,7 @@ func CreateUploadVideo(client *vod.Client, r *CreateUploadVideoRequest) (respons @@ -64,7 +64,7 @@ func CreateUploadVideo(client *vod.Client, r *CreateUploadVideoRequest) (respons
64 if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil { 64 if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil {
65 log.Error(e) 65 log.Error(e)
66 } else { 66 } else {
67 - response.FileURL = up.GetFileUrl("") 67 + response.FileURL = up.GetFileUrl(beego.AppConfig.String("cname"))
68 } 68 }
69 return 69 return
70 } 70 }
@@ -85,7 +85,7 @@ func RefreshUploadVideo(client *vod.Client, r *RefreshUploadVideoRequest) (respo @@ -85,7 +85,7 @@ func RefreshUploadVideo(client *vod.Client, r *RefreshUploadVideoRequest) (respo
85 if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil { 85 if up, e := ParseUploadAddress(rsp.UploadAddress); e != nil {
86 log.Error(e) 86 log.Error(e)
87 } else { 87 } else {
88 - response.FileURL = up.GetFileUrl("") 88 + response.FileURL = up.GetFileUrl(beego.AppConfig.String("cname"))
89 } 89 }
90 return 90 return
91 } 91 }