master
huanghai 5 years ago
parent 7d5cb4fcee
commit 5e09d5cd54

@ -663,13 +663,9 @@ func checkOpenId(context *gin.Context) {
//3、写cookie //3、写cookie
context.SetCookie(ConfigUtil.AccessToken, encodeString, 0, "/", "", false, true) context.SetCookie(ConfigUtil.AccessToken, encodeString, 0, "/", "", false, true)
//4、跳转到XXX页面比如集成页或者管理员的首页 //4、跳转到XXX页面比如集成页或者管理员的首页
if identityId == 1 { context.JSON(http.StatusOK, map[string]interface{}{"success": true, "openId": openId})
context.Redirect(301, "/dsBaseWeb/#/organization/bureau")
} else {
context.Redirect(301, "/dsBaseWeb/pages/personPortal/")
}
} else { } else {
//2、如果此OpenId没有实现过挂接应该跳转到绑定用户页面 //2、如果此OpenId没有实现过挂接应该跳转到绑定用户页面
context.Redirect(301, "/sso/static/bindUser.html?openId="+openId) context.JSON(http.StatusOK, map[string]interface{}{"success": false, "openId": openId})
} }
} }

@ -738,7 +738,7 @@ type swaggerInfo struct {
// SwaggerInfo holds exported Swagger Info so clients can modify it // SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{ var SwaggerInfo = swaggerInfo{
Version: "2.0", Version: "2.0",
Host: "10.10.14.187:8000", Host: "127.0.0.1:8000",
BasePath: "", BasePath: "",
Schemes: []string{}, Schemes: []string{},
Title: "东师理想统一认证中心(OAuth2+Sso)", Title: "东师理想统一认证中心(OAuth2+Sso)",

@ -7,7 +7,7 @@
"license": {}, "license": {},
"version": "2.0" "version": "2.0"
}, },
"host": "10.10.14.187:8000", "host": "127.0.0.1:8000",
"paths": { "paths": {
"/oauth2/access_token": { "/oauth2/access_token": {
"post": { "post": {

@ -32,7 +32,7 @@ definitions:
description: 个数 description: 个数
type: object type: object
type: object type: object
host: 10.10.14.187:8000 host: 127.0.0.1:8000
info: info:
contact: {} contact: {}
description: 参考自xxl-sso description: 参考自xxl-sso

@ -67,7 +67,7 @@ func startOAuth2Server() {
// @title 东师理想统一认证中心(OAuth2+Sso) // @title 东师理想统一认证中心(OAuth2+Sso)
// @version 2.0 // @version 2.0
// @description 参考自xxl-sso // @description 参考自xxl-sso
// @host 10.10.14.187:8000 // @host 127.0.0.1:8000
func main() { func main() {
// 发布模式 // 发布模式
//gin.SetMode(gin.ReleaseMode) //gin.SetMode(gin.ReleaseMode)

@ -34,6 +34,12 @@
}, },
async: false, async: false,
success: function (result) { success: function (result) {
//if identityId == 1 {
// context.Redirect(301, "/dsBaseWeb/#/organization/bureau")
//} else {
// context.Redirect(301, "/dsBaseWeb/pages/personPortal/")
//}
//context.Redirect(301, "/sso/static/bindUser.html?openId="+openId)
} }
}); });

Loading…
Cancel
Save