跳转
This commit is contained in:
parent
4dba6c7669
commit
b35278771e
@ -4,10 +4,11 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/pkg/common"
|
||||
"github.com/BurntSushi/toml"
|
||||
"gopkg.in/ini.v1"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
"gopkg.in/ini.v1"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -108,15 +109,16 @@ type Redis struct {
|
||||
}
|
||||
|
||||
type System struct {
|
||||
Mode string
|
||||
AppMode string
|
||||
Version string
|
||||
HttpPort string
|
||||
Host string
|
||||
RedirectUri string
|
||||
Domain string
|
||||
ErpHost string
|
||||
FieeHost string
|
||||
Mode string
|
||||
AppMode string
|
||||
Version string
|
||||
HttpPort string
|
||||
Host string
|
||||
RedirectUri string
|
||||
Domain string
|
||||
ErpHost string
|
||||
FieeHost string
|
||||
AuthRedirectUrl string
|
||||
}
|
||||
type Oss struct {
|
||||
AccessKeyId string
|
||||
|
@ -6,6 +6,8 @@ Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
ErpHost = "http://114.218.158.24:9020"
|
||||
FieeHost = "http://114.218.158.24:9020"
|
||||
AuthRedirectUrl = "http://172.16.100.99:9028/media_account"
|
||||
|
||||
[bos]
|
||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||
|
@ -6,6 +6,7 @@ Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
ErpHost = "https://erpapi.fontree.cn"
|
||||
FieeHost = "https://erpapi.fiee.com"
|
||||
AuthRedirectUrl = "https://erp.fiee.com/media_account"
|
||||
[bos]
|
||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||
|
@ -6,6 +6,7 @@ Host = "https://common.szjixun.cn"
|
||||
RedirectUri = "/api/redirect/url"
|
||||
ErpHost = "http://114.218.158.24:9020"
|
||||
FieeHost = "https://saas-test.szjixun.cn"
|
||||
AuthRedirectUrl = "http://172.16.100.99:9028/media_account"
|
||||
[bos]
|
||||
Ak = "ALTAKxrqOQHnAN525Tb2GX4Bhe"
|
||||
Sk = "d2ecaa9d75114d3b9f42b99014198306"
|
||||
|
@ -3,6 +3,7 @@ package cast
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"fonchain-fiee/api/accountFiee"
|
||||
"fonchain-fiee/api/bundle"
|
||||
"fonchain-fiee/api/cast"
|
||||
@ -10,6 +11,7 @@ import (
|
||||
"fonchain-fiee/pkg/e"
|
||||
modelCast "fonchain-fiee/pkg/model/cast"
|
||||
"fonchain-fiee/pkg/service"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
||||
@ -212,15 +214,19 @@ func OAuth2Callback(ctx *gin.Context) {
|
||||
service.Error(ctx, errors.New(e.GetMsg(e.InvalidParams)))
|
||||
return
|
||||
}
|
||||
resp, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
||||
_, err := service.CastProvider.OAuthCodeToToken(ctx, req)
|
||||
if err != nil {
|
||||
service.Error(ctx, err)
|
||||
fmt.Println(fmt.Sprintf("%s?%s", config.AppConfig.System.AuthRedirectUrl, "status=0"))
|
||||
ctx.Redirect(http.StatusFound, fmt.Sprintf("%s?%s", config.AppConfig.System.AuthRedirectUrl, "status=0"))
|
||||
return
|
||||
}
|
||||
service.Success(ctx, map[string]interface{}{
|
||||
"req": req,
|
||||
"resp": resp,
|
||||
})
|
||||
// TODO 跳转到前端页面
|
||||
ctx.Redirect(http.StatusFound, fmt.Sprintf("%s?%s", config.AppConfig.System.AuthRedirectUrl, "status=1"))
|
||||
//service.Success(ctx, map[string]interface{}{
|
||||
// "req": req,
|
||||
// "resp": resp,
|
||||
//})
|
||||
|
||||
return
|
||||
}
|
||||
func RefreshToken(ctx *gin.Context) {
|
||||
|
Loading…
Reference in New Issue
Block a user