From ebc46d553068396811d70fb98be636afce17d335 Mon Sep 17 00:00:00 2001 From: huanghai <10402852@qq.com> Date: Mon, 3 Aug 2020 08:40:30 +0800 Subject: [PATCH] 'commit' --- dsBaseWeb/Handler/SsoHandler.go | 18 +-- dsBaseWeb/docs/docs.go | 206 ++++++++++++++++---------------- dsBaseWeb/docs/swagger.json | 206 ++++++++++++++++---------------- dsBaseWeb/docs/swagger.yaml | 2 +- dsBaseWeb/main.go | 2 +- 5 files changed, 218 insertions(+), 216 deletions(-) diff --git a/dsBaseWeb/Handler/SsoHandler.go b/dsBaseWeb/Handler/SsoHandler.go index 7ce2b84f..9bd7d4fe 100644 --- a/dsBaseWeb/Handler/SsoHandler.go +++ b/dsBaseWeb/Handler/SsoHandler.go @@ -41,6 +41,16 @@ func init() { func SsoHandler() gin.HandlerFunc { return func(c *gin.Context) { + //写入浏览器ID + if cookie, err := c.Request.Cookie("browser_id"); err == nil { + value := cookie.Value + if len(value) == 0 { + cookie.Value = CommonUtil.GetUUID() + } + http.SetCookie(c.Writer, cookie) + c.Next() + } + //获取访问的完整地址(包括参数) requestUri := c.Request.RequestURI host := c.Request.Host @@ -101,14 +111,6 @@ func SsoHandler() gin.HandlerFunc { if needLoginFlag { c.Abort() - //植入一个写入未登录用户访问时记录浏览器ID或者机器ID的方法 - _, err := c.Request.Cookie("browser_id") - if err == nil { - } else { - //没有设置过 - c.SetCookie("browser_id", CommonUtil.GetUUID(), -1, "/", "", false, true) - } - //将访问的全整路径进行base64加码 oauthCallback := base64.StdEncoding.EncodeToString([]byte("http://" + host + requestUri)) loginUrl := ssoServer + authCodeURI + "?client_id=" + clientId + "&redirect_uri=" + redirectURI + "&response_type=" + responseType + "&oauth_callback=" + oauthCallback + "&device_id=1" diff --git a/dsBaseWeb/docs/docs.go b/dsBaseWeb/docs/docs.go index e2d36fd2..15276869 100644 --- a/dsBaseWeb/docs/docs.go +++ b/dsBaseWeb/docs/docs.go @@ -1981,7 +1981,7 @@ var doc = `{ "type": "object" } }, - "host": "127.0.0.1:8002", + "host": "10.10.14.187:8002", "info": { "contact": { "email": "support@swagger.io", @@ -1997,12 +1997,12 @@ var doc = `{ "version": "1.0" }, "paths": { - "/base/business/UpdateBaseBusiness": { + "/base/business/DeleteBaseBusiness": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "修改业务系统信息", + "description": "删除业务系统信息", "parameters": [ { "description": "业务系统编码", @@ -2010,13 +2010,6 @@ var doc = `{ "name": "businessCode", "required": true, "type": "string" - }, - { - "description": "业务系统名称", - "in": "formData", - "name": "businessName", - "required": true, - "type": "string" } ], "produces": [ @@ -2030,20 +2023,16 @@ var doc = `{ } } }, - "summary": "修改业务系统信息", + "summary": "删除业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode", - "businessName" + "businessCode" ], "x-lengthlimit": [ { "businessCode": "6,6" - }, - { - "businessName": "1:50" } ], "x-rolelimit": [ @@ -2051,19 +2040,26 @@ var doc = `{ ] } }, - "/base/business/GetBaseBusiness": { - "get": { + "/base/business/UpdateBaseBusiness": { + "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "获取业务系统信息(单条)", + "description": "修改业务系统信息", "parameters": [ { "description": "业务系统编码", - "in": "query", + "in": "formData", "name": "businessCode", "required": true, "type": "string" + }, + { + "description": "业务系统名称", + "in": "formData", + "name": "businessName", + "required": true, + "type": "string" } ], "produces": [ @@ -2077,16 +2073,20 @@ var doc = `{ } } }, - "summary": "获取业务系统信息(单条)", + "summary": "修改业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode" + "businessCode", + "businessName" ], "x-lengthlimit": [ { "businessCode": "6,6" + }, + { + "businessName": "1:50" } ], "x-rolelimit": [ @@ -2094,26 +2094,19 @@ var doc = `{ ] } }, - "/base/business/AddBaseBusiness": { - "post": { + "/base/business/GetBaseBusiness": { + "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "增加业务系统信息", + "description": "获取业务系统信息(单条)", "parameters": [ { "description": "业务系统编码", - "in": "formData", + "in": "query", "name": "businessCode", "required": true, "type": "string" - }, - { - "description": "业务系统名称", - "in": "formData", - "name": "businessName", - "required": true, - "type": "string" } ], "produces": [ @@ -2127,20 +2120,16 @@ var doc = `{ } } }, - "summary": "增加业务系统信息", + "summary": "获取业务系统信息(单条)", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode", - "businessName" + "businessCode" ], "x-lengthlimit": [ { - "businessCode": "6:6" - }, - { - "businessName": "1:50" + "businessCode": "6,6" } ], "x-rolelimit": [ @@ -2198,12 +2187,12 @@ var doc = `{ ] } }, - "/base/business/DeleteBaseBusiness": { + "/base/business/AddBaseBusiness": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "删除业务系统信息", + "description": "增加业务系统信息", "parameters": [ { "description": "业务系统编码", @@ -2211,6 +2200,13 @@ var doc = `{ "name": "businessCode", "required": true, "type": "string" + }, + { + "description": "业务系统名称", + "in": "formData", + "name": "businessName", + "required": true, + "type": "string" } ], "produces": [ @@ -2224,16 +2220,20 @@ var doc = `{ } } }, - "summary": "删除业务系统信息", + "summary": "增加业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode" + "businessCode", + "businessName" ], "x-lengthlimit": [ { - "businessCode": "6,6" + "businessCode": "6:6" + }, + { + "businessName": "1:50" } ], "x-rolelimit": [ @@ -3564,12 +3564,12 @@ var doc = `{ ] } }, - "/base/student/ExportStudentAccountExcel": { + "/base/student/ExportStudentExcel": { "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "导出本校学生账号信息到EXCEL", + "description": "导出本校学生信息到EXCEL", "parameters": [ { "description": "学校ID", @@ -3596,7 +3596,7 @@ var doc = `{ } } }, - "summary": "导出本校学生账号信息到EXCEL", + "summary": "导出本校学生信息到EXCEL", "tags": [ "学生信息" ], @@ -3621,12 +3621,12 @@ var doc = `{ ] } }, - "/base/student/ExportStudentExcel": { + "/base/student/ExportStudentAccountExcel": { "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "导出本校学生信息到EXCEL", + "description": "导出本校学生账号信息到EXCEL", "parameters": [ { "description": "学校ID", @@ -3653,7 +3653,7 @@ var doc = `{ } } }, - "summary": "导出本校学生信息到EXCEL", + "summary": "导出本校学生账号信息到EXCEL", "tags": [ "学生信息" ], @@ -8881,58 +8881,6 @@ var doc = `{ ] } }, - "/base/area/GetGovArea": { - "get": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "description": "获取行政区划信息(单条)", - "parameters": [ - { - "description": "行政区划码", - "in": "query", - "name": "areaCode", - "required": true, - "type": "string" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Model.Res" - } - } - }, - "summary": "获取行政区划信息(单条)", - "tags": [ - "行政区划" - ], - "x-emptylimit": [ - "areaCode" - ], - "x-intlimit": [ - "areaCode" - ], - "x-lengthlimit": [ - { - "areaCode": "6,6" - } - ], - "x-rolelimit": [ - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, "/base/area/DeleteGovArea": { "post": { "consumes": [ @@ -9137,6 +9085,58 @@ var doc = `{ ] } }, + "/base/area/GetGovArea": { + "get": { + "consumes": [ + "application/x-www-form-urlencoded" + ], + "description": "获取行政区划信息(单条)", + "parameters": [ + { + "description": "行政区划码", + "in": "query", + "name": "areaCode", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Model.Res" + } + } + }, + "summary": "获取行政区划信息(单条)", + "tags": [ + "行政区划" + ], + "x-emptylimit": [ + "areaCode" + ], + "x-intlimit": [ + "areaCode" + ], + "x-lengthlimit": [ + { + "areaCode": "6,6" + } + ], + "x-rolelimit": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, "/base/role/GetManageAreaInfo": { "get": { "consumes": [ diff --git a/dsBaseWeb/docs/swagger.json b/dsBaseWeb/docs/swagger.json index ed387234..871a0dca 100644 --- a/dsBaseWeb/docs/swagger.json +++ b/dsBaseWeb/docs/swagger.json @@ -1966,7 +1966,7 @@ "type": "object" } }, - "host": "127.0.0.1:8002", + "host": "10.10.14.187:8002", "info": { "contact": { "email": "support@swagger.io", @@ -1982,12 +1982,12 @@ "version": "1.0" }, "paths": { - "/base/business/UpdateBaseBusiness": { + "/base/business/DeleteBaseBusiness": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "修改业务系统信息", + "description": "删除业务系统信息", "parameters": [ { "description": "业务系统编码", @@ -1995,13 +1995,6 @@ "name": "businessCode", "required": true, "type": "string" - }, - { - "description": "业务系统名称", - "in": "formData", - "name": "businessName", - "required": true, - "type": "string" } ], "produces": [ @@ -2015,20 +2008,16 @@ } } }, - "summary": "修改业务系统信息", + "summary": "删除业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode", - "businessName" + "businessCode" ], "x-lengthlimit": [ { "businessCode": "6,6" - }, - { - "businessName": "1:50" } ], "x-rolelimit": [ @@ -2036,19 +2025,26 @@ ] } }, - "/base/business/GetBaseBusiness": { - "get": { + "/base/business/UpdateBaseBusiness": { + "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "获取业务系统信息(单条)", + "description": "修改业务系统信息", "parameters": [ { "description": "业务系统编码", - "in": "query", + "in": "formData", "name": "businessCode", "required": true, "type": "string" + }, + { + "description": "业务系统名称", + "in": "formData", + "name": "businessName", + "required": true, + "type": "string" } ], "produces": [ @@ -2062,16 +2058,20 @@ } } }, - "summary": "获取业务系统信息(单条)", + "summary": "修改业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode" + "businessCode", + "businessName" ], "x-lengthlimit": [ { "businessCode": "6,6" + }, + { + "businessName": "1:50" } ], "x-rolelimit": [ @@ -2079,26 +2079,19 @@ ] } }, - "/base/business/AddBaseBusiness": { - "post": { + "/base/business/GetBaseBusiness": { + "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "增加业务系统信息", + "description": "获取业务系统信息(单条)", "parameters": [ { "description": "业务系统编码", - "in": "formData", + "in": "query", "name": "businessCode", "required": true, "type": "string" - }, - { - "description": "业务系统名称", - "in": "formData", - "name": "businessName", - "required": true, - "type": "string" } ], "produces": [ @@ -2112,20 +2105,16 @@ } } }, - "summary": "增加业务系统信息", + "summary": "获取业务系统信息(单条)", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode", - "businessName" + "businessCode" ], "x-lengthlimit": [ { - "businessCode": "6:6" - }, - { - "businessName": "1:50" + "businessCode": "6,6" } ], "x-rolelimit": [ @@ -2183,12 +2172,12 @@ ] } }, - "/base/business/DeleteBaseBusiness": { + "/base/business/AddBaseBusiness": { "post": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "删除业务系统信息", + "description": "增加业务系统信息", "parameters": [ { "description": "业务系统编码", @@ -2196,6 +2185,13 @@ "name": "businessCode", "required": true, "type": "string" + }, + { + "description": "业务系统名称", + "in": "formData", + "name": "businessName", + "required": true, + "type": "string" } ], "produces": [ @@ -2209,16 +2205,20 @@ } } }, - "summary": "删除业务系统信息", + "summary": "增加业务系统信息", "tags": [ "业务系统维护" ], "x-emptylimit": [ - "businessCode" + "businessCode", + "businessName" ], "x-lengthlimit": [ { - "businessCode": "6,6" + "businessCode": "6:6" + }, + { + "businessName": "1:50" } ], "x-rolelimit": [ @@ -3549,12 +3549,12 @@ ] } }, - "/base/student/ExportStudentAccountExcel": { + "/base/student/ExportStudentExcel": { "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "导出本校学生账号信息到EXCEL", + "description": "导出本校学生信息到EXCEL", "parameters": [ { "description": "学校ID", @@ -3581,7 +3581,7 @@ } } }, - "summary": "导出本校学生账号信息到EXCEL", + "summary": "导出本校学生信息到EXCEL", "tags": [ "学生信息" ], @@ -3606,12 +3606,12 @@ ] } }, - "/base/student/ExportStudentExcel": { + "/base/student/ExportStudentAccountExcel": { "get": { "consumes": [ "application/x-www-form-urlencoded" ], - "description": "导出本校学生信息到EXCEL", + "description": "导出本校学生账号信息到EXCEL", "parameters": [ { "description": "学校ID", @@ -3638,7 +3638,7 @@ } } }, - "summary": "导出本校学生信息到EXCEL", + "summary": "导出本校学生账号信息到EXCEL", "tags": [ "学生信息" ], @@ -8866,58 +8866,6 @@ ] } }, - "/base/area/GetGovArea": { - "get": { - "consumes": [ - "application/x-www-form-urlencoded" - ], - "description": "获取行政区划信息(单条)", - "parameters": [ - { - "description": "行政区划码", - "in": "query", - "name": "areaCode", - "required": true, - "type": "string" - } - ], - "produces": [ - "application/json" - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/Model.Res" - } - } - }, - "summary": "获取行政区划信息(单条)", - "tags": [ - "行政区划" - ], - "x-emptylimit": [ - "areaCode" - ], - "x-intlimit": [ - "areaCode" - ], - "x-lengthlimit": [ - { - "areaCode": "6,6" - } - ], - "x-rolelimit": [ - "1", - "2", - "3", - "4", - "5", - "6", - "7" - ] - } - }, "/base/area/DeleteGovArea": { "post": { "consumes": [ @@ -9122,6 +9070,58 @@ ] } }, + "/base/area/GetGovArea": { + "get": { + "consumes": [ + "application/x-www-form-urlencoded" + ], + "description": "获取行政区划信息(单条)", + "parameters": [ + { + "description": "行政区划码", + "in": "query", + "name": "areaCode", + "required": true, + "type": "string" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Model.Res" + } + } + }, + "summary": "获取行政区划信息(单条)", + "tags": [ + "行政区划" + ], + "x-emptylimit": [ + "areaCode" + ], + "x-intlimit": [ + "areaCode" + ], + "x-lengthlimit": [ + { + "areaCode": "6,6" + } + ], + "x-rolelimit": [ + "1", + "2", + "3", + "4", + "5", + "6", + "7" + ] + } + }, "/base/role/GetManageAreaInfo": { "get": { "consumes": [ diff --git a/dsBaseWeb/docs/swagger.yaml b/dsBaseWeb/docs/swagger.yaml index e98e5fec..c7d48230 100644 --- a/dsBaseWeb/docs/swagger.yaml +++ b/dsBaseWeb/docs/swagger.yaml @@ -1492,7 +1492,7 @@ definitions: example: "true" type: boolean type: object -host: 127.0.0.1:8002 +host: 10.10.14.187:8002 info: contact: email: support@swagger.io diff --git a/dsBaseWeb/main.go b/dsBaseWeb/main.go index 155a7a8a..c82076d0 100644 --- a/dsBaseWeb/main.go +++ b/dsBaseWeb/main.go @@ -31,7 +31,7 @@ import ( // @contact.email support@swagger.io // @license.name Apache 2.0 // @license.url http://www.apache.org/licenses/LICENSE-2.0.html -// @host 127.0.0.1:8002 +// @host 10.10.14.187:8002 func main() { // 发布模式 //gin.SetMode(gin.ReleaseMode)