Modify: Decide whether to redirect when previewing based on storage policy

This commit is contained in:
HFO4
2019-12-31 13:09:26 +08:00
parent eceee2fc76
commit 8a262a15d5
7 changed files with 144 additions and 34 deletions

View File

@@ -151,7 +151,9 @@ func Preview(c *gin.Context) {
// 是否需要重定向
if res.Code == -301 {
c.Redirect(301, res.Data.(string))
return
}
// 是否有错误发生
if res.Code != 0 {
c.JSON(200, res)
}