|
@@ -2,24 +2,18 @@ package hdl |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
offical "applet/app/db/official" |
|
|
offical "applet/app/db/official" |
|
|
"applet/app/e" |
|
|
|
|
|
"github.com/gin-gonic/gin" |
|
|
"github.com/gin-gonic/gin" |
|
|
) |
|
|
) |
|
|
|
|
|
|
|
|
func KuaishouAuth(c *gin.Context) { |
|
|
func KuaishouAuth(c *gin.Context) { |
|
|
var args map[string]string |
|
|
|
|
|
if err := c.ShouldBindJSON(&args); err != nil { |
|
|
|
|
|
e.OutErr(c, 200, e.ERR_INVALID_ARGS) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
kuaishouOfficialAccessToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_access_token") |
|
|
kuaishouOfficialAccessToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_access_token") |
|
|
kuaishouOfficialAccessToken = args["access_token"] |
|
|
|
|
|
|
|
|
kuaishouOfficialAccessToken = c.PostForm("access_token") |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_access_token", kuaishouOfficialAccessToken) |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_access_token", kuaishouOfficialAccessToken) |
|
|
kuaishouOfficialExpiresIn := offical.MasterListCfgGetOneData("0", "kuaishou_official_expires_in") |
|
|
kuaishouOfficialExpiresIn := offical.MasterListCfgGetOneData("0", "kuaishou_official_expires_in") |
|
|
kuaishouOfficialExpiresIn = args["expires_in"] |
|
|
|
|
|
|
|
|
kuaishouOfficialExpiresIn = c.PostForm("expires_in") |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_expires_in", kuaishouOfficialExpiresIn) |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_expires_in", kuaishouOfficialExpiresIn) |
|
|
kuaishouOfficialRefreshToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_refresh_token") |
|
|
kuaishouOfficialRefreshToken := offical.MasterListCfgGetOneData("0", "kuaishou_official_refresh_token") |
|
|
kuaishouOfficialRefreshToken = args["refresh_token"] |
|
|
|
|
|
|
|
|
kuaishouOfficialRefreshToken = c.PostForm("refresh_token") |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_refresh_token", kuaishouOfficialRefreshToken) |
|
|
offical.MasterListCfgSave("0", "kuaishou_official_refresh_token", kuaishouOfficialRefreshToken) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |