Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
nizhengjia888
gin-vue-admin
提交
e648dfe7
G
gin-vue-admin
项目概览
nizhengjia888
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e648dfe7
编写于
3月 20, 2020
作者:
Mr.奇淼(
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更改为shouldBindJson 不主动修改 400
上级
856aeba3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
35 deletion
+35
-35
QMPlusServer/controller/api/exa_customer.go
QMPlusServer/controller/api/exa_customer.go
+9
-9
QMPlusServer/controller/api/exa_fileUploadAndDownload.go
QMPlusServer/controller/api/exa_fileUploadAndDownload.go
+1
-1
QMPlusServer/controller/api/sys_api.go
QMPlusServer/controller/api/sys_api.go
+4
-4
QMPlusServer/controller/api/sys_authority.go
QMPlusServer/controller/api/sys_authority.go
+2
-2
QMPlusServer/controller/api/sys_menu.go
QMPlusServer/controller/api/sys_menu.go
+7
-7
QMPlusServer/controller/api/sys_user.go
QMPlusServer/controller/api/sys_user.go
+11
-11
QMPlusVuePage/src/view/login/login.vue
QMPlusVuePage/src/view/login/login.vue
+1
-1
未找到文件。
QMPlusServer/controller/api/exa_customer.go
浏览文件 @
e648dfe7
...
...
@@ -19,7 +19,7 @@ import (
// @Router /customer/createExaCustomer [post]
func
CreateExaCustomer
(
c
*
gin
.
Context
)
{
var
cu
dbModel
.
ExaCustomer
_
=
c
.
BindJSON
(
&
cu
)
_
=
c
.
Should
BindJSON
(
&
cu
)
claims
,
_
:=
c
.
Get
(
"claims"
)
waitUse
:=
claims
.
(
*
middleware
.
CustomClaims
)
cu
.
SysUserID
=
waitUse
.
ID
...
...
@@ -42,7 +42,7 @@ func CreateExaCustomer(c *gin.Context) {
// @Router /customer/deleteExaCustomer [post]
func
DeleteExaCustomer
(
c
*
gin
.
Context
)
{
var
cu
dbModel
.
ExaCustomer
_
=
c
.
BindJSON
(
&
cu
)
_
=
c
.
Should
BindJSON
(
&
cu
)
err
:=
cu
.
DeleteExaCustomer
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"创建失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -61,7 +61,7 @@ func DeleteExaCustomer(c *gin.Context) {
// @Router /customer/updataExaCustomer [post]
func
UpdataExaCustomer
(
c
*
gin
.
Context
)
{
var
cu
dbModel
.
ExaCustomer
_
=
c
.
BindJSON
(
&
cu
)
_
=
c
.
Should
BindJSON
(
&
cu
)
err
:=
cu
.
UpdataExaCustomer
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"创建失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -80,13 +80,13 @@ func UpdataExaCustomer(c *gin.Context) {
// @Router /customer/getExaCustomer [post]
func
GetExaCustomer
(
c
*
gin
.
Context
)
{
var
cu
dbModel
.
ExaCustomer
_
=
c
.
BindJSON
(
&
cu
)
err
,
customer
:=
cu
.
GetExaCustomer
()
_
=
c
.
Should
BindJSON
(
&
cu
)
err
,
customer
:=
cu
.
GetExaCustomer
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"创建失败:%v"
,
err
),
gin
.
H
{})
}
else
{
servers
.
ReportFormat
(
c
,
true
,
"创建成功"
,
gin
.
H
{
"customer"
:
customer
,
"customer"
:
customer
,
})
}
}
...
...
@@ -105,16 +105,16 @@ func GetExaCustomerList(c *gin.Context) {
var
cu
dbModel
.
ExaCustomer
cu
.
SysUserAuthorityID
=
waitUse
.
AuthorityId
var
pageInfo
modelInterface
.
PageInfo
_
=
c
.
BindJSON
(
&
pageInfo
)
_
=
c
.
Should
BindJSON
(
&
pageInfo
)
err
,
customerList
,
total
:=
cu
.
GetInfoList
(
pageInfo
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"创建失败:%v"
,
err
),
gin
.
H
{})
}
else
{
servers
.
ReportFormat
(
c
,
true
,
"创建成功"
,
gin
.
H
{
"customer"
:
customerList
,
"customer"
:
customerList
,
"total"
:
total
,
"page"
:
pageInfo
.
Page
,
"pageSize"
:
pageInfo
.
PageSize
,
})
}
}
\ No newline at end of file
}
QMPlusServer/controller/api/exa_fileUploadAndDownload.go
浏览文件 @
e648dfe7
...
...
@@ -85,7 +85,7 @@ func DeleteFile(c *gin.Context) {
// @Router /fileUploadAndDownload/getFileList [post]
func
GetFileList
(
c
*
gin
.
Context
)
{
var
pageInfo
modelInterface
.
PageInfo
_
=
c
.
BindJSON
(
&
pageInfo
)
_
=
c
.
Should
BindJSON
(
&
pageInfo
)
err
,
list
,
total
:=
new
(
dbModel
.
ExaFileUploadAndDownload
)
.
GetInfoList
(
pageInfo
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取数据失败,%v"
,
err
),
gin
.
H
{})
...
...
QMPlusServer/controller/api/sys_api.go
浏览文件 @
e648dfe7
...
...
@@ -27,7 +27,7 @@ type DeleteApiParams struct {
// @Router /api/createApi [post]
func
CreateApi
(
c
*
gin
.
Context
)
{
var
api
sysModel
.
SysApi
_
=
c
.
BindJSON
(
&
api
)
_
=
c
.
Should
BindJSON
(
&
api
)
err
:=
api
.
CreateApi
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"创建失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -46,7 +46,7 @@ func CreateApi(c *gin.Context) {
// @Router /api/deleteApi [post]
func
DeleteApi
(
c
*
gin
.
Context
)
{
var
a
sysModel
.
SysApi
_
=
c
.
BindJSON
(
&
a
)
_
=
c
.
Should
BindJSON
(
&
a
)
err
:=
a
.
DeleteApi
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"删除失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -102,7 +102,7 @@ func GetApiList(c *gin.Context) {
// @Router /api/getApiById [post]
func
GetApiById
(
c
*
gin
.
Context
)
{
var
idInfo
GetById
_
=
c
.
BindJSON
(
&
idInfo
)
_
=
c
.
Should
BindJSON
(
&
idInfo
)
err
,
api
:=
new
(
sysModel
.
SysApi
)
.
GetApiById
(
idInfo
.
Id
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取数据失败,%v"
,
err
),
gin
.
H
{})
...
...
@@ -124,7 +124,7 @@ func GetApiById(c *gin.Context) {
// @Router /api/updataApi [post]
func
UpdataApi
(
c
*
gin
.
Context
)
{
var
api
sysModel
.
SysApi
_
=
c
.
BindJSON
(
&
api
)
_
=
c
.
Should
BindJSON
(
&
api
)
err
:=
api
.
UpdataApi
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"修改数据失败,%v"
,
err
),
gin
.
H
{})
...
...
QMPlusServer/controller/api/sys_authority.go
浏览文件 @
e648dfe7
...
...
@@ -50,7 +50,7 @@ type DeleteAuthorityPatams struct {
// @Router /authority/deleteAuthority [post]
func
DeleteAuthority
(
c
*
gin
.
Context
)
{
var
a
sysModel
.
SysAuthority
_
=
c
.
BindJSON
(
&
a
)
_
=
c
.
Should
BindJSON
(
&
a
)
//删除角色之前需要判断是否有用户正在使用此角色
err
:=
a
.
DeleteAuthority
()
if
err
!=
nil
{
...
...
@@ -70,7 +70,7 @@ func DeleteAuthority(c *gin.Context) {
// @Router /authority/getAuthorityList [post]
func
GetAuthorityList
(
c
*
gin
.
Context
)
{
var
pageInfo
modelInterface
.
PageInfo
_
=
c
.
BindJSON
(
&
pageInfo
)
_
=
c
.
Should
BindJSON
(
&
pageInfo
)
err
,
list
,
total
:=
new
(
sysModel
.
SysAuthority
)
.
GetInfoList
(
pageInfo
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取数据失败,%v"
,
err
),
gin
.
H
{})
...
...
QMPlusServer/controller/api/sys_menu.go
浏览文件 @
e648dfe7
...
...
@@ -37,7 +37,7 @@ func GetMenu(c *gin.Context) {
// @Router /menu/getMenuList [post]
func
GetMenuList
(
c
*
gin
.
Context
)
{
var
pageInfo
modelInterface
.
PageInfo
_
=
c
.
BindJSON
(
&
pageInfo
)
_
=
c
.
Should
BindJSON
(
&
pageInfo
)
err
,
menuList
,
total
:=
new
(
sysModel
.
SysBaseMenu
)
.
GetInfoList
(
pageInfo
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取数据失败,%v"
,
err
),
gin
.
H
{})
...
...
@@ -61,7 +61,7 @@ func GetMenuList(c *gin.Context) {
// @Router /menu/addBaseMenu [post]
func
AddBaseMenu
(
c
*
gin
.
Context
)
{
var
addMenu
sysModel
.
SysBaseMenu
_
=
c
.
BindJSON
(
&
addMenu
)
_
=
c
.
Should
BindJSON
(
&
addMenu
)
err
:=
addMenu
.
AddBaseMenu
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"添加失败,%v"
,
err
),
gin
.
H
{})
...
...
@@ -101,7 +101,7 @@ type AddMenuAuthorityInfo struct {
// @Router /menu/addMenuAuthority [post]
func
AddMenuAuthority
(
c
*
gin
.
Context
)
{
var
addMenuAuthorityInfo
AddMenuAuthorityInfo
_
=
c
.
BindJSON
(
&
addMenuAuthorityInfo
)
_
=
c
.
Should
BindJSON
(
&
addMenuAuthorityInfo
)
err
:=
new
(
sysModel
.
SysMenu
)
.
AddMenuAuthority
(
addMenuAuthorityInfo
.
Menus
,
addMenuAuthorityInfo
.
AuthorityId
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"添加失败,%v"
,
err
),
gin
.
H
{})
...
...
@@ -124,7 +124,7 @@ type AuthorityIdInfo struct {
// @Router /menu/addMenuAuthority [post]
func
GetMenuAuthority
(
c
*
gin
.
Context
)
{
var
authorityIdInfo
AuthorityIdInfo
_
=
c
.
BindJSON
(
&
authorityIdInfo
)
_
=
c
.
Should
BindJSON
(
&
authorityIdInfo
)
err
,
menus
:=
new
(
sysModel
.
SysMenu
)
.
GetMenuAuthority
(
authorityIdInfo
.
AuthorityId
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取失败:%v"
,
err
),
gin
.
H
{
"menus"
:
menus
})
...
...
@@ -147,7 +147,7 @@ type IdInfo struct {
// @Router /menu/deleteBaseMenu [post]
func
DeleteBaseMenu
(
c
*
gin
.
Context
)
{
var
idInfo
IdInfo
_
=
c
.
BindJSON
(
&
idInfo
)
_
=
c
.
Should
BindJSON
(
&
idInfo
)
err
:=
new
(
sysModel
.
SysBaseMenu
)
.
DeleteBaseMenu
(
idInfo
.
Id
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"删除失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -166,7 +166,7 @@ func DeleteBaseMenu(c *gin.Context) {
// @Router /menu/updataBaseMen [post]
func
UpdataBaseMenu
(
c
*
gin
.
Context
)
{
var
menu
sysModel
.
SysBaseMenu
_
=
c
.
BindJSON
(
&
menu
)
_
=
c
.
Should
BindJSON
(
&
menu
)
err
:=
menu
.
UpdataBaseMenu
()
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"修改失败:%v"
,
err
),
gin
.
H
{})
...
...
@@ -189,7 +189,7 @@ type GetById struct {
// @Router /menu/getBaseMenuById [post]
func
GetBaseMenuById
(
c
*
gin
.
Context
)
{
var
idInfo
GetById
_
=
c
.
BindJSON
(
&
idInfo
)
_
=
c
.
Should
BindJSON
(
&
idInfo
)
err
,
menu
:=
new
(
sysModel
.
SysBaseMenu
)
.
GetBaseMenuById
(
idInfo
.
Id
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"查询失败:%v"
,
err
),
gin
.
H
{})
...
...
QMPlusServer/controller/api/sys_user.go
浏览文件 @
e648dfe7
...
...
@@ -22,10 +22,10 @@ var (
)
type
RegistAndLoginStuct
struct
{
Username
string
`json:"username"`
Password
string
`json:"password"`
Captcha
string
`json:"captcha"`
CaptchaId
string
`json:"captchaId"`
Username
string
`json:"username"`
Password
string
`json:"password"`
Captcha
string
`json:"captcha"`
CaptchaId
string
`json:"captchaId"`
}
type
RegestStuct
struct
{
...
...
@@ -44,7 +44,7 @@ type RegestStuct struct {
// @Router /base/regist [post]
func
Regist
(
c
*
gin
.
Context
)
{
var
R
RegestStuct
_
=
c
.
BindJSON
(
&
R
)
_
=
c
.
Should
BindJSON
(
&
R
)
user
:=
&
sysModel
.
SysUser
{
Username
:
R
.
Username
,
NickName
:
R
.
NickName
,
Password
:
R
.
Password
,
HeaderImg
:
R
.
HeaderImg
,
AuthorityId
:
R
.
AuthorityId
}
err
,
user
:=
user
.
Regist
()
if
err
!=
nil
{
...
...
@@ -66,15 +66,15 @@ func Regist(c *gin.Context) {
// @Router /base/login [post]
func
Login
(
c
*
gin
.
Context
)
{
var
L
RegistAndLoginStuct
_
=
c
.
BindJSON
(
&
L
)
if
captcha
.
VerifyString
(
L
.
CaptchaId
,
L
.
Captcha
)
{
_
=
c
.
Should
BindJSON
(
&
L
)
if
captcha
.
VerifyString
(
L
.
CaptchaId
,
L
.
Captcha
)
{
U
:=
&
sysModel
.
SysUser
{
Username
:
L
.
Username
,
Password
:
L
.
Password
}
if
err
,
user
:=
U
.
Login
();
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"用户名密码错误或%v"
,
err
),
gin
.
H
{})
}
else
{
tokenNext
(
c
,
*
user
)
}
}
else
{
}
else
{
servers
.
ReportFormat
(
c
,
false
,
"验证码错误"
,
gin
.
H
{})
}
...
...
@@ -149,7 +149,7 @@ type ChangePasswordStutrc struct {
// @Router /user/changePassword [post]
func
ChangePassword
(
c
*
gin
.
Context
)
{
var
params
ChangePasswordStutrc
_
=
c
.
BindJSON
(
&
params
)
_
=
c
.
Should
BindJSON
(
&
params
)
U
:=
&
sysModel
.
SysUser
{
Username
:
params
.
Username
,
Password
:
params
.
Password
}
if
err
,
_
:=
U
.
ChangePassword
(
params
.
NewPassword
);
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
"修改失败,请检查用户名密码"
,
gin
.
H
{})
...
...
@@ -208,7 +208,7 @@ func UploadHeaderImg(c *gin.Context) {
// @Router /user/getUserList [post]
func
GetUserList
(
c
*
gin
.
Context
)
{
var
pageInfo
modelInterface
.
PageInfo
_
=
c
.
BindJSON
(
&
pageInfo
)
_
=
c
.
Should
BindJSON
(
&
pageInfo
)
err
,
list
,
total
:=
new
(
sysModel
.
SysUser
)
.
GetInfoList
(
pageInfo
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"获取数据失败,%v"
,
err
),
gin
.
H
{})
...
...
@@ -237,7 +237,7 @@ type SetUserAuth struct {
// @Router /user/setUserAuthority [post]
func
SetUserAuthority
(
c
*
gin
.
Context
)
{
var
sua
SetUserAuth
_
=
c
.
BindJSON
(
&
sua
)
_
=
c
.
Should
BindJSON
(
&
sua
)
err
:=
new
(
sysModel
.
SysUser
)
.
SetUserAuthority
(
sua
.
UUID
,
sua
.
AuthorityId
)
if
err
!=
nil
{
servers
.
ReportFormat
(
c
,
false
,
fmt
.
Sprintf
(
"修改失败,%v"
,
err
),
gin
.
H
{})
...
...
QMPlusVuePage/src/view/login/login.vue
浏览文件 @
e648dfe7
...
...
@@ -20,7 +20,7 @@
<el-input
v-model=
"loginForm.captcha"
name=
"logVerify"
placeholder=
"请输入验证码"
placeholder=
"请输入验证码
(测试环境有问题可不输入 本地搭建环境可用)
"
maxlength=
"10"
/>
<img
:src=
"path + picPath"
alt=
"请输入验证码"
@
click=
"loginVefify()"
class=
"vPic"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录