diff --git a/QMPlusServer/controller/api/exa_fileUploadAndDownload.go b/QMPlusServer/controller/api/exa_fileUploadAndDownload.go index e67ca0d3f404769df95b97a399b1b9cda920124f..747d09d2b497211e9aebf64ed5e81f0be57db8dc 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 752f616224ff15d63a470f92f218435a879f0c7e..29f98a372c5bb8b342be8d483f7054ab4d3b312f 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 7ec8228dfa527ca9ddf610918def8f57f6f9f5a9..1278e075909f38a775c7638f3324a0ae47753358 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 879051a29739fdfb17ae82ed23b53fac251c2b7e..0000000000000000000000000000000000000000 --- 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 9cc3395f4233a9ec0dac3b64a65814c97d94ab8f..e2fe3c1fb1b0bc90d564c6acdf468b570f268138 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 a28da79a3476e99891a56965c4356d4e564666f2..cc8feb432c145d20b84531f6a531ac43a3734fe9 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 10e3421cdc12b231785a14d365ba749fc2023714..e1a85729d5207c03f2cc79ecda589b6db316a1ff 100644 --- a/QMPlusVuePage/src/view/example/upload/upload.vue +++ b/QMPlusVuePage/src/view/example/upload/upload.vue @@ -1,12 +1,12 @@