diff --git a/rest/matter_controller.go b/rest/matter_controller.go index 3cf8222..4693b13 100644 --- a/rest/matter_controller.go +++ b/rest/matter_controller.go @@ -204,22 +204,26 @@ func (this *MatterController) Upload(writer http.ResponseWriter, request *http.R } user = this.userDao.CheckByUuid(userUuid) - puuid := request.FormValue("puuid") - if puuid == "" { - return this.Error("puuid必填") - } else { - if puuid != "root" { - //找出上一级的文件夹。 - this.matterDao.FindByUuidAndUserUuid(puuid, userUuid) - - } - - } - alienStr := request.FormValue("alien") alien := false + puuid := "" if alienStr == "true" { alien = true + + //如果是应用文件的话,统一放在同一个地方。 + puuid = this.matterService.GetDirUuid(userUuid, "/应用数据") + + } else { + puuid = request.FormValue("puuid") + if puuid == "" { + return this.Error("puuid必填") + } else { + if puuid != "root" { + //找出上一级的文件夹。 + this.matterDao.FindByUuidAndUserUuid(puuid, userUuid) + + } + } } request.ParseMultipartForm(32 << 20) diff --git a/rest/user_controller.go b/rest/user_controller.go index d9ec1d0..e592667 100644 --- a/rest/user_controller.go +++ b/rest/user_controller.go @@ -138,6 +138,7 @@ func (this *UserController) Create(writer http.ResponseWriter, request *http.Req //编辑一个用户的资料。 func (this *UserController) Edit(writer http.ResponseWriter, request *http.Request) *WebResult { + avatarUrl := request.FormValue("avatarUrl") uuid := request.FormValue("uuid") phone := request.FormValue("phone") gender := request.FormValue("gender") @@ -151,7 +152,7 @@ func (this *UserController) Edit(writer http.ResponseWriter, request *http.Reque } user := this.userDao.CheckByUuid(uuid) - + user.AvatarUrl = avatarUrl user.Phone = phone user.Gender = GetGender(gender) user.City = city