|
|
|
@ -424,14 +424,25 @@ func logout(context *gin.Context) {
|
|
|
|
|
}
|
|
|
|
|
//清除cookie
|
|
|
|
|
SsoUtil.DeleteSsoCookie(context)
|
|
|
|
|
|
|
|
|
|
//判断来源是内网还是外网,是指客户端的IP地址,即浏览器的IP
|
|
|
|
|
ipStart := strings.Split(context.Request.Host, ".")[0]
|
|
|
|
|
isIntranetIP := strings.Index("10,192,172", ipStart)
|
|
|
|
|
//外网
|
|
|
|
|
var s string
|
|
|
|
|
if isIntranetIP < 0 {
|
|
|
|
|
s = "defaultIndexWwUrl"
|
|
|
|
|
} else { //内网
|
|
|
|
|
s = "defaultIndexNwUrl"
|
|
|
|
|
}
|
|
|
|
|
//跳转回去,系统默认统一的回调首页
|
|
|
|
|
list, err := DaoBaseGlobal.GetGlobalInfoByValue(`defaultIndexUrl`)
|
|
|
|
|
list, err := DaoBaseGlobal.GetGlobalInfoByValue(s)
|
|
|
|
|
if err != nil || len(list) == 0 {
|
|
|
|
|
msg := "获取全局变量defaultIndexUrl失败!"
|
|
|
|
|
context.JSON(http.StatusOK, map[string]interface{}{"success": false, "msg": msg})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
globalValue := list[0]["global_value"].(string)
|
|
|
|
|
context.Redirect(302, string(globalValue))
|
|
|
|
|
context.Redirect(302, globalValue)
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|