From f102620038da1e13d0634b31d0bf146670ee4550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=90=89=E5=85=86?= <303176530@qq.com> Date: Wed, 14 Apr 2021 23:19:25 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=BA=9F=E5=BC=83=E4=B8=83=E7=89=9B?= =?UTF-8?q?=E4=BA=91=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/config.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/config.yaml b/server/config.yaml index d57d6963..bb2244d7 100644 --- a/server/config.yaml +++ b/server/config.yaml @@ -84,14 +84,14 @@ autocode: web-form: /view web-table: /view -# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket �?域名地址) +# qiniu configuration (请自行七牛申请对应的 公钥 私钥 bucket 和 域名地址) qiniu: - zone: 'ZoneHuadong' - bucket: 'qm-plus-img' - img-path: 'http://qmplusimg.henrongyi.top' + zone: 'ZoneHuaDong' + bucket: '' + img-path: '' use-https: false - access-key: '25j8dYBZ2wuiy0yhwShytjZDTX662b8xiFguwxzZ' - secret-key: 'pgdbqEsf7ooZh7W3xokP833h3dZ_VecFXPDeG5JY' + access-key: '' + secret-key: '' use-cdn-domains: false From 02ec7be271608a4eeb6de7e8c1522fceae8722cb Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Fri, 7 May 2021 17:48:19 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9casbin=E7=89=88=E6=9C=AC?= =?UTF-8?q?=20=E9=98=B2=E6=AD=A2=E7=94=A8=E6=88=B7=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/go.mod | 4 +- server/source/casbin.go | 296 +++++++++++++++++------------------ web/src/view/login/login.vue | 1 - 3 files changed, 150 insertions(+), 151 deletions(-) diff --git a/server/go.mod b/server/go.mod index e9900c03..231eed65 100644 --- a/server/go.mod +++ b/server/go.mod @@ -8,8 +8,8 @@ require ( github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/aliyun/aliyun-oss-go-sdk v2.1.6+incompatible github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect - github.com/casbin/casbin/v2 v2.25.6 - github.com/casbin/gorm-adapter/v3 v3.2.6 + github.com/casbin/casbin/v2 v2.11.0 + github.com/casbin/gorm-adapter/v3 v3.0.2 github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/fsnotify/fsnotify v1.4.9 diff --git a/server/source/casbin.go b/server/source/casbin.go index 6c56f9a0..a7b642c5 100644 --- a/server/source/casbin.go +++ b/server/source/casbin.go @@ -13,154 +13,154 @@ var Casbin = new(casbin) type casbin struct{} var carbines = []gormadapter.CasbinRule{ - {Ptype: "p", V0: "888", V1: "/base/login", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/user/register", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/createApi", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/getApiList", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/getApiById", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/deleteApi", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/updateApi", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/api/getAllApis", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/authority/createAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/authority/deleteAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/authority/getAuthorityList", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/authority/setDataAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/getMenu", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/getMenuList", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/addBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/user/changePassword", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/user/getUserList", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/user/deleteUser", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/casbin/casbinTest/:pathParam", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/jwt/jsonInBlacklist", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/system/getSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/system/setSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/system/getServerInfo", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/customer/customer", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/customer/customer", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/customer/customer", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/customer/customer", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/customer/customerList", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/autoCode/createTemp", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/autoCode/preview", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/autoCode/getTables", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/autoCode/getDB", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/autoCode/getColumn", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/createSysDictionaryDetail", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/deleteSysDictionaryDetail", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysDictionaryDetail/getSysDictionaryDetailList", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysDictionary/createSysDictionary", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/sysDictionary/deleteSysDictionary", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/sysDictionary/updateSysDictionary", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/sysDictionary/findSysDictionary", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysDictionary/getSysDictionaryList", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/createSysOperationRecord", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecord", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/updateSysOperationRecord", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/findSysOperationRecord", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/getSysOperationRecordList", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecordByIds", V2: "DELETE"}, - {Ptype: "p", V0: "888", V1: "/user/setUserInfo", V2: "PUT"}, - {Ptype: "p", V0: "888", V1: "/email/emailTest", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/simpleUploader/upload", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/excel/importExcel", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/excel/loadExcel", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/excel/exportExcel", V2: "POST"}, - {Ptype: "p", V0: "888", V1: "/excel/downloadTemplate", V2: "GET"}, - {Ptype: "p", V0: "888", V1: "/api/deleteApisByIds", V2: "DELETE"}, - {Ptype: "p", V0: "8881", V1: "/base/login", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/user/register", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/createApi", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/authority/setDataAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/getMenu", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/getMenuList", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/addBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/user/changePassword", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/user/getUserList", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/user/setUserAuthority", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/system/getSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/system/setSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "POST"}, - {Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "PUT"}, - {Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "DELETE"}, - {Ptype: "p", V0: "8881", V1: "/customer/customer", V2: "GET"}, - {Ptype: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"}, - {Ptype: "p", V0: "9528", V1: "/base/login", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/user/register", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/createApi", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/authority/getAuthorityList", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/authority/setDataAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/getMenu", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/getMenuList", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/addBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/user/changePassword", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/user/getUserList", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/user/setUserAuthority", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/system/getSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/system/setSystemConfig", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "POST"}, - {Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "PUT"}, - {Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "DELETE"}, - {Ptype: "p", V0: "9528", V1: "/customer/customer", V2: "GET"}, - {Ptype: "p", V0: "9528", V1: "/customer/customerList", V2: "GET"}, - {Ptype: "p", V0: "9528", V1: "/autoCode/createTemp", V2: "POST"}, + {PType: "p", V0: "888", V1: "/base/login", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/register", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/createApi", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/getApiList", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/getApiById", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/deleteApi", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/updateApi", V2: "POST"}, + {PType: "p", V0: "888", V1: "/api/getAllApis", V2: "POST"}, + {PType: "p", V0: "888", V1: "/authority/createAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/authority/deleteAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/authority/getAuthorityList", V2: "POST"}, + {PType: "p", V0: "888", V1: "/authority/setDataAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/authority/updateAuthority", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/authority/copyAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/getMenu", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/getMenuList", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/addBaseMenu", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/getBaseMenuTree", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/addMenuAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/getMenuAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/deleteBaseMenu", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/updateBaseMenu", V2: "POST"}, + {PType: "p", V0: "888", V1: "/menu/getBaseMenuById", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/changePassword", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/getUserList", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"}, + {PType: "p", V0: "888", V1: "/user/deleteUser", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"}, + {PType: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, + {PType: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "888", V1: "/casbin/updateCasbin", V2: "POST"}, + {PType: "p", V0: "888", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, + {PType: "p", V0: "888", V1: "/casbin/casbinTest/:pathParam", V2: "GET"}, + {PType: "p", V0: "888", V1: "/jwt/jsonInBlacklist", V2: "POST"}, + {PType: "p", V0: "888", V1: "/system/getSystemConfig", V2: "POST"}, + {PType: "p", V0: "888", V1: "/system/setSystemConfig", V2: "POST"}, + {PType: "p", V0: "888", V1: "/system/getServerInfo", V2: "POST"}, + {PType: "p", V0: "888", V1: "/customer/customer", V2: "POST"}, + {PType: "p", V0: "888", V1: "/customer/customer", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/customer/customer", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/customer/customer", V2: "GET"}, + {PType: "p", V0: "888", V1: "/customer/customerList", V2: "GET"}, + {PType: "p", V0: "888", V1: "/autoCode/createTemp", V2: "POST"}, + {PType: "p", V0: "888", V1: "/autoCode/preview", V2: "POST"}, + {PType: "p", V0: "888", V1: "/autoCode/getTables", V2: "GET"}, + {PType: "p", V0: "888", V1: "/autoCode/getDB", V2: "GET"}, + {PType: "p", V0: "888", V1: "/autoCode/getColumn", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysDictionaryDetail/createSysDictionaryDetail", V2: "POST"}, + {PType: "p", V0: "888", V1: "/sysDictionaryDetail/deleteSysDictionaryDetail", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/sysDictionaryDetail/updateSysDictionaryDetail", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/sysDictionaryDetail/findSysDictionaryDetail", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysDictionaryDetail/getSysDictionaryDetailList", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysDictionary/createSysDictionary", V2: "POST"}, + {PType: "p", V0: "888", V1: "/sysDictionary/deleteSysDictionary", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/sysDictionary/updateSysDictionary", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/sysDictionary/findSysDictionary", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysDictionary/getSysDictionaryList", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/createSysOperationRecord", V2: "POST"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecord", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/updateSysOperationRecord", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/findSysOperationRecord", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/getSysOperationRecordList", V2: "GET"}, + {PType: "p", V0: "888", V1: "/sysOperationRecord/deleteSysOperationRecordByIds", V2: "DELETE"}, + {PType: "p", V0: "888", V1: "/user/setUserInfo", V2: "PUT"}, + {PType: "p", V0: "888", V1: "/email/emailTest", V2: "POST"}, + {PType: "p", V0: "888", V1: "/simpleUploader/upload", V2: "POST"}, + {PType: "p", V0: "888", V1: "/simpleUploader/checkFileMd5", V2: "GET"}, + {PType: "p", V0: "888", V1: "/simpleUploader/mergeFileMd5", V2: "GET"}, + {PType: "p", V0: "888", V1: "/excel/importExcel", V2: "POST"}, + {PType: "p", V0: "888", V1: "/excel/loadExcel", V2: "GET"}, + {PType: "p", V0: "888", V1: "/excel/exportExcel", V2: "POST"}, + {PType: "p", V0: "888", V1: "/excel/downloadTemplate", V2: "GET"}, + {PType: "p", V0: "888", V1: "/api/deleteApisByIds", V2: "DELETE"}, + {PType: "p", V0: "8881", V1: "/base/login", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/user/register", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/createApi", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/getApiList", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/getApiById", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/deleteApi", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/updateApi", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/api/getAllApis", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/authority/createAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/authority/deleteAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/authority/getAuthorityList", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/authority/setDataAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/getMenu", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/getMenuList", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/addBaseMenu", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/getBaseMenuTree", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/addMenuAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/getMenuAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/deleteBaseMenu", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/updateBaseMenu", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/menu/getBaseMenuById", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/user/changePassword", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/user/getUserList", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/user/setUserAuthority", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/upload", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/casbin/updateCasbin", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/jwt/jsonInBlacklist", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/system/getSystemConfig", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/system/setSystemConfig", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/customer/customer", V2: "POST"}, + {PType: "p", V0: "8881", V1: "/customer/customer", V2: "PUT"}, + {PType: "p", V0: "8881", V1: "/customer/customer", V2: "DELETE"}, + {PType: "p", V0: "8881", V1: "/customer/customer", V2: "GET"}, + {PType: "p", V0: "8881", V1: "/customer/customerList", V2: "GET"}, + {PType: "p", V0: "9528", V1: "/base/login", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/user/register", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/createApi", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/getApiList", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/getApiById", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/deleteApi", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/updateApi", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/api/getAllApis", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/authority/createAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/authority/deleteAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/authority/getAuthorityList", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/authority/setDataAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/getMenu", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/getMenuList", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/addBaseMenu", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/getBaseMenuTree", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/addMenuAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/getMenuAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/deleteBaseMenu", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/updateBaseMenu", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/menu/getBaseMenuById", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/user/changePassword", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/user/getUserList", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/user/setUserAuthority", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/upload", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/getFileList", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/casbin/updateCasbin", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/casbin/getPolicyPathByAuthorityId", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/jwt/jsonInBlacklist", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/system/getSystemConfig", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/system/setSystemConfig", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/customer/customer", V2: "POST"}, + {PType: "p", V0: "9528", V1: "/customer/customer", V2: "PUT"}, + {PType: "p", V0: "9528", V1: "/customer/customer", V2: "DELETE"}, + {PType: "p", V0: "9528", V1: "/customer/customer", V2: "GET"}, + {PType: "p", V0: "9528", V1: "/customer/customerList", V2: "GET"}, + {PType: "p", V0: "9528", V1: "/autoCode/createTemp", V2: "POST"}, } //@author: [SliverHorn](https://github.com/SliverHorn) diff --git a/web/src/view/login/login.vue b/web/src/view/login/login.vue index 0faf57b1..2a5a6da5 100644 --- a/web/src/view/login/login.vue +++ b/web/src/view/login/login.vue @@ -7,7 +7,6 @@
- Gin-Vue-Admin
From 278635bf4c578fb449493073af4bd9e5d7914df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=92=8B=E5=90=89=E5=85=86?= <303176530@qq.com> Date: Sun, 9 May 2021 19:26:08 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=20=E8=AF=AF=E5=88=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=99=BB=E9=99=86=E8=8F=9C=E5=8D=95=E5=90=8E=E4=B8=8D=E5=86=8D?= =?UTF-8?q?=E7=99=BD=E5=B1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/main.js | 4 ++-- web/src/permission.js | 20 +++++++++++++------- web/src/view/login/login.vue | 4 ++-- web/src/view/superAdmin/user/user.vue | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/web/src/main.js b/web/src/main.js index 31d6a7bc..d381a97e 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -151,7 +151,7 @@ console.log(` 欢迎使用 Gin-Vue-Admin 当前版本:V2.4.1 加群方式:微信:shouzi_1994 QQ群:622360840 - 默认自动化文档地址:http://127.0.0.1:` + process.env.VUE_APP_SERVER_PORT + `/swagger/index.html - 默认前端文件运行地址:http://127.0.0.1:`+ process.env.VUE_APP_CLI_PORT` + 默认自动化文档地址:http://127.0.0.1:${process.env.VUE_APP_SERVER_PORT}/swagger/index.html + 默认前端文件运行地址:http://127.0.0.1:${process.env.VUE_APP_CLI_PORT} 如果项目让您获得了收益,希望您能请团队喝杯可乐:https://www.gin-vue-admin.com/docs/coffee `) \ No newline at end of file diff --git a/web/src/permission.js b/web/src/permission.js index 1015217a..07cc154e 100644 --- a/web/src/permission.js +++ b/web/src/permission.js @@ -4,11 +4,11 @@ import getPageTitle from '@/utils/page' let asyncRouterFlag = 0 -const whiteList = ['login','init'] -router.beforeEach(async(to, from, next) => { +const whiteList = ['login', 'init'] +router.beforeEach(async (to, from, next) => { const token = store.getters['user/token'] - // 在白名单中的判断情况 - //修改网页标签名称 + // 在白名单中的判断情况 + //修改网页标签名称 document.title = getPageTitle(to.meta.title) if (whiteList.indexOf(to.name) > -1) { if (token) { @@ -24,10 +24,16 @@ router.beforeEach(async(to, from, next) => { asyncRouterFlag++ await store.dispatch('router/SetAsyncRouter') const asyncRouters = store.getters['router/asyncRouters'] - router.addRoutes(asyncRouters) - next({...to, replace: true }) + asyncRouters.forEach(item => { + router.addRoute(item) + }) + next({ ...to, replace: true }) } else { - next() + if (to.matched.length) { + next() + } else { + next({ path: "/layout/404" }) + } } } // 不在白名单中并且未登陆的时候 diff --git a/web/src/view/login/login.vue b/web/src/view/login/login.vue index 2a5a6da5..7aeb82af 100644 --- a/web/src/view/login/login.vue +++ b/web/src/view/login/login.vue @@ -90,14 +90,14 @@ export default { name: "Login", data() { const checkUsername = (rule, value, callback) => { - if (value.length < 5 || value.length > 12) { + if (value.length < 5) { return callback(new Error("请输入正确的用户名")); } else { callback(); } }; const checkPassword = (rule, value, callback) => { - if (value.length < 6 || value.length > 12) { + if (value.length < 6) { return callback(new Error("请输入正确的密码")); } else { callback(); diff --git a/web/src/view/superAdmin/user/user.vue b/web/src/view/superAdmin/user/user.vue index 7a625e69..100c26b5 100644 --- a/web/src/view/superAdmin/user/user.vue +++ b/web/src/view/superAdmin/user/user.vue @@ -121,7 +121,7 @@ export default { rules: { username: [ { required: true, message: "请输入用户名", trigger: "blur" }, - { min: 6, message: "最低6位字符", trigger: "blur" } + { min: 5, message: "最低5位字符", trigger: "blur" } ], password: [ { required: true, message: "请输入用户密码", trigger: "blur" },