This commit is contained in:
戴育兵 2025-09-24 11:47:16 +08:00
parent 4dba6c7669
commit b35278771e
5 changed files with 29 additions and 17 deletions

View File

@ -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 (
@ -117,6 +118,7 @@ type System struct {
Domain string
ErpHost string
FieeHost string
AuthRedirectUrl string
}
type Oss struct {
AccessKeyId string

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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) {