修复订阅无法正常获取的错误
This commit is contained in:
@@ -74,14 +74,8 @@ func UserGetSubscribe(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
baseURL := strings.TrimRight(service.GetAppURL(), "/")
|
||||
if baseURL == "" {
|
||||
scheme := "http"
|
||||
if c.Request.TLS != nil {
|
||||
scheme = "https"
|
||||
}
|
||||
baseURL = scheme + "://" + c.Request.Host
|
||||
}
|
||||
baseURL := requestBaseURL(c)
|
||||
subscribePath := service.GetSubscribePath()
|
||||
|
||||
Success(c, gin.H{
|
||||
"plan_id": user.PlanID,
|
||||
@@ -96,7 +90,7 @@ func UserGetSubscribe(c *gin.Context) {
|
||||
"speed_limit": user.SpeedLimit,
|
||||
"next_reset_at": user.NextResetAt,
|
||||
"plan": user.Plan,
|
||||
"subscribe_url": strings.TrimRight(baseURL, "/") + "/s/" + user.Token,
|
||||
"subscribe_url": strings.TrimRight(baseURL, "/") + "/" + subscribePath + "/" + user.Token,
|
||||
"reset_day": nil,
|
||||
})
|
||||
}
|
||||
@@ -129,15 +123,8 @@ func UserResetSecurity(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
baseURL := strings.TrimRight(service.GetAppURL(), "/")
|
||||
if baseURL == "" {
|
||||
scheme := "http"
|
||||
if c.Request.TLS != nil {
|
||||
scheme = "https"
|
||||
}
|
||||
baseURL = scheme + "://" + c.Request.Host
|
||||
}
|
||||
Success(c, strings.TrimRight(baseURL, "/")+"/s/"+newToken)
|
||||
baseURL := requestBaseURL(c)
|
||||
Success(c, strings.TrimRight(baseURL, "/")+"/"+service.GetSubscribePath()+"/"+newToken)
|
||||
}
|
||||
|
||||
func UserUpdate(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user