From 4972cc3adb6db60e0ebfcbea5a65d6f5de8378fd Mon Sep 17 00:00:00 2001 From: pixel <303176530@qq.com> Date: Sun, 15 Dec 2019 15:10:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0=E7=9A=84?= =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=B7=AF=E5=BE=84=E6=96=B9=E6=B3=95=20?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E5=BD=95=E5=85=A5=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=BF=85=E9=A1=BB=E5=88=B7=E6=96=B0=E6=89=8D?= =?UTF-8?q?=E8=83=BD=E6=94=B9=E5=8F=98=E8=8F=9C=E5=8D=95=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/exa_fileUploadAndDownload.go | 5 +- QMPlusServer/controller/api/sys_user.go | 8 +- QMPlusServer/model/sysModel/sys_user.go | 2 +- QMPlusVuePage/src/components/HelloWorld.vue | 58 ---------- QMPlusVuePage/src/store/module/user.js | 1 + .../src/view/example/excel/excel.vue | 97 ++++++++++------ .../src/view/example/upload/upload.vue | 6 +- QMPlusVuePage/src/view/login/regist.vue | 10 +- QMPlusVuePage/src/view/person/person.vue | 8 +- .../src/view/superAdmin/user/user.vue | 109 +++++++++++++++++- 10 files changed, 191 insertions(+), 113 deletions(-) delete mode 100644 QMPlusVuePage/src/components/HelloWorld.vue diff --git a/QMPlusServer/controller/api/exa_fileUploadAndDownload.go b/QMPlusServer/controller/api/exa_fileUploadAndDownload.go index e67ca0d3..747d09d2 100644 --- a/QMPlusServer/controller/api/exa_fileUploadAndDownload.go +++ b/QMPlusServer/controller/api/exa_fileUploadAndDownload.go @@ -18,6 +18,7 @@ import ( // @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}" // @Router /fileUploadAndDownload/upload [post] func UploadFile(c *gin.Context) { + noSave := c.DefaultQuery("noSave","0") _, header, err := c.Request.FormFile("file") if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("上传文件失败,%v", err), gin.H{}) @@ -34,7 +35,9 @@ func UploadFile(c *gin.Context) { s := strings.Split(file.Name, ".") file.Tag = s[len(s)-1] file.Key = key - err := file.Upload() + if(noSave=="0"){ + err = file.Upload() + } if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("修改数据库链接失败,%v", err), gin.H{}) } else { diff --git a/QMPlusServer/controller/api/sys_user.go b/QMPlusServer/controller/api/sys_user.go index 752f6162..29f98a37 100644 --- a/QMPlusServer/controller/api/sys_user.go +++ b/QMPlusServer/controller/api/sys_user.go @@ -26,15 +26,13 @@ type RegistAndLoginStuct struct { // @Tags Base // @Summary 用户注册账号 // @Produce application/json -// @Param data body api.RegistAndLoginStuct true "用户注册接口" +// @Param data body sysModel.SysUser true "用户注册接口" // @Success 200 {string} string "{"success":true,"data":{},"msg":"注册成功"}" // @Router /base/regist [post] func Regist(c *gin.Context) { - var R RegistAndLoginStuct + var R sysModel.SysUser _ = c.BindJSON(&R) - - U := &sysModel.SysUser{Username: R.Username, Password: R.Password} - err, user := U.Regist() + err, user := R.Regist() if err != nil { servers.ReportFormat(c, false, fmt.Sprintf("%v", err), gin.H{ "user": user, diff --git a/QMPlusServer/model/sysModel/sys_user.go b/QMPlusServer/model/sysModel/sys_user.go index 7ec8228d..1278e075 100644 --- a/QMPlusServer/model/sysModel/sys_user.go +++ b/QMPlusServer/model/sysModel/sys_user.go @@ -18,7 +18,7 @@ type SysUser struct { NickName string `json:"nickName" gorm:"default:'QMPlusUser'"` HeaderImg string `json:"headerImg" gorm:"default:'http://www.henrongyi.top/avatar/lufu.jpg'"` Authority SysAuthority `json:"authority" gorm:"ForeignKey:AuthorityId;AssociationForeignKey:AuthorityId"` - AuthorityId string `json:"-" gorm:"default:888"` + AuthorityId string `json:"authorityId" gorm:"default:888"` } //type Propertie struct { diff --git a/QMPlusVuePage/src/components/HelloWorld.vue b/QMPlusVuePage/src/components/HelloWorld.vue deleted file mode 100644 index 879051a2..00000000 --- a/QMPlusVuePage/src/components/HelloWorld.vue +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - diff --git a/QMPlusVuePage/src/store/module/user.js b/QMPlusVuePage/src/store/module/user.js index 9cc3395f..e2fe3c1f 100644 --- a/QMPlusVuePage/src/store/module/user.js +++ b/QMPlusVuePage/src/store/module/user.js @@ -30,6 +30,7 @@ export const user = { state.token = "" state.expiresAt = "" router.push({ name: 'login', replace: true }) + window.location.reload() }, ResetUserInfo(state, userInfo = {}) { state.userInfo = {...state.userInfo, diff --git a/QMPlusVuePage/src/view/example/excel/excel.vue b/QMPlusVuePage/src/view/example/excel/excel.vue index a28da79a..cc8feb43 100644 --- a/QMPlusVuePage/src/view/example/excel/excel.vue +++ b/QMPlusVuePage/src/view/example/excel/excel.vue @@ -1,48 +1,69 @@ \ No newline at end of file diff --git a/QMPlusVuePage/src/view/example/upload/upload.vue b/QMPlusVuePage/src/view/example/upload/upload.vue index 10e3421c..e1a85729 100644 --- a/QMPlusVuePage/src/view/example/upload/upload.vue +++ b/QMPlusVuePage/src/view/example/upload/upload.vue @@ -1,12 +1,12 @@