From 30d2c1a472751ccf2e77a38dc219d14ba763516b Mon Sep 17 00:00:00 2001 From: QM303176530 <303176530@qq.com> Date: Tue, 7 Apr 2020 21:54:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=92=E5=BA=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=EF=BC=8C=E4=BF=AE=E6=94=B9=E9=94=99=E5=88=AB=E5=AD=97?= =?UTF-8?q?=20dashbord->dashboard=20=E9=9C=80=E6=9B=B4=E6=96=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93=E4=B8=ADbase=5Fmenu=E8=A1=A8=E4=B8=AD=20?= =?UTF-8?q?=E6=89=80=E6=9C=89=E7=9A=84dashbord=E6=94=B9=E4=B8=BAdashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/model/sys_api.go | 8 ++++++- web/src/utils/stringFun.js | 13 +++++++++++ web/src/utils/toUpperCase.js | 7 ------ .../component/animition.vue | 0 .../view/{dashbord => dashboard}/index.vue | 2 +- web/src/view/superAdmin/api/api.vue | 22 +++++++++++++------ web/src/view/systemTools/autoCode/index.vue | 2 +- 7 files changed, 37 insertions(+), 17 deletions(-) create mode 100644 web/src/utils/stringFun.js delete mode 100644 web/src/utils/toUpperCase.js rename web/src/view/{dashbord => dashboard}/component/animition.vue (100%) rename web/src/view/{dashbord => dashboard}/index.vue (93%) diff --git a/server/model/sys_api.go b/server/model/sys_api.go index b31215c9..e665609b 100644 --- a/server/model/sys_api.go +++ b/server/model/sys_api.go @@ -130,7 +130,13 @@ func (a *SysApi) GetInfoList(info PageInfo, Order string, Desc bool) (err error, } else { db = db.Limit(limit).Offset(offset) if Order != "" { - err = db.Order(Order+" desc", true).Find(&apiList).Error + var OrderStr string + if Desc { + OrderStr = Order + " desc" + } else { + OrderStr = Order + } + err = db.Order(OrderStr, true).Find(&apiList).Error } else { err = db.Order("api_group", true).Find(&apiList).Error } diff --git a/web/src/utils/stringFun.js b/web/src/utils/stringFun.js new file mode 100644 index 00000000..b0b6fb84 --- /dev/null +++ b/web/src/utils/stringFun.js @@ -0,0 +1,13 @@ +export const toUpperCase = (str) => { + if (str[0]) { + return str.replace(str[0], str[0].toUpperCase()) + } else { + return "" + } +} + +// 驼峰转换下划线 +export const toSQLLine = (str) => { + if (str=="ID") return "ID" + return str.replace(/([A-Z])/g,"_$1").toLowerCase(); + } \ No newline at end of file diff --git a/web/src/utils/toUpperCase.js b/web/src/utils/toUpperCase.js deleted file mode 100644 index 42d5a223..00000000 --- a/web/src/utils/toUpperCase.js +++ /dev/null @@ -1,7 +0,0 @@ -export const toUpperCase = (str) => { - if (str[0]) { - return str.replace(str[0], str[0].toUpperCase()) - } else { - return "" - } -} \ No newline at end of file diff --git a/web/src/view/dashbord/component/animition.vue b/web/src/view/dashboard/component/animition.vue similarity index 100% rename from web/src/view/dashbord/component/animition.vue rename to web/src/view/dashboard/component/animition.vue diff --git a/web/src/view/dashbord/index.vue b/web/src/view/dashboard/index.vue similarity index 93% rename from web/src/view/dashbord/index.vue rename to web/src/view/dashboard/index.vue index b020fe97..91b09b93 100644 --- a/web/src/view/dashbord/index.vue +++ b/web/src/view/dashboard/index.vue @@ -27,7 +27,7 @@