diff --git a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java index bd5e657..fafb160 100644 --- a/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java +++ b/src/main/java/io/linfeng/modules/admin/service/impl/AppUserServiceImpl.java @@ -229,6 +229,12 @@ public class AppUserServiceImpl extends ServiceImpl i if(!ObjectUtil.isEmpty(appUserUpdateForm.getGender())){ user.setGender(appUserUpdateForm.getGender()); } + if(!ObjectUtil.isEmpty(appUserUpdateForm.getUsername())){ + user.setUsername(appUserUpdateForm.getUsername()); + } + if(!ObjectUtil.isEmpty(appUserUpdateForm.getIntro())){ + user.setIntro(appUserUpdateForm.getIntro()); + } baseMapper.updateById(user); redisUtils.delete(RedisKeys.getUserKey(user.getUid())); } diff --git a/src/main/java/io/linfeng/modules/app/param/AppUserUpdateForm.java b/src/main/java/io/linfeng/modules/app/param/AppUserUpdateForm.java index 22ac73d..f9db98b 100644 --- a/src/main/java/io/linfeng/modules/app/param/AppUserUpdateForm.java +++ b/src/main/java/io/linfeng/modules/app/param/AppUserUpdateForm.java @@ -15,18 +15,21 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -/** - * app用户信息修改 - * - */ + @Data -@ApiModel(value = "app用户信息修改") +@ApiModel(value = "app用户信息修改请求体") public class AppUserUpdateForm { - @ApiModelProperty(value = "头像") + @ApiModelProperty(value = "LF头像") private String avatar; - @ApiModelProperty(value = "性别") + @ApiModelProperty(value = "LF昵称") + private String username; + + @ApiModelProperty(value = "LF个性签名") + private String intro; + + @ApiModelProperty(value = "LF性别") private Integer gender; } diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages.json b/src/main/resources/static/linfeng-community-uniapp-ky/pages.json index a231b70..3037b30 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages.json +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages.json @@ -68,7 +68,7 @@ "path" : "pages/user/edit", "style" : { - "navigationBarTitleText": "", + "navigationBarTitleText": "个人信息维护", "enablePullDownRefresh": false } diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/edit.vue b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/edit.vue index 4736564..4deb340 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/edit.vue +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/edit.vue @@ -6,19 +6,22 @@ - + + input-align="right"/> - + + + 保存个人信息 + 退出登录 @@ -31,6 +34,10 @@ export default { data() { return { + saveBtnStyle: { + color: "#fff", + backgroundColor: '#8f8fd6' + }, btnStyle: { color: "#fff", backgroundColor: '#333333' @@ -50,7 +57,9 @@ value: 0, label: "保密" } - ] + ], + username:"", + intro:"" }; }, onShow(options) { @@ -60,6 +69,24 @@ openGender(){ this.showGender = true }, + saveInfo(){ + if (!this.username) { + this.$u.toast('昵称不能为空'); + return; + } + if (!this.intro) { + this.$u.toast('个性签名不能为空'); + return; + } + this.$H.post("user/userInfoEdit", { + username: this.username, + intro: this.intro + }).then(res => { + if (res.code == 0) { + this.$u.toast('个人信息更新成功'); + } + }) + }, // 修改性别 saveGender(index) { let gender = index[0].value; @@ -68,12 +95,15 @@ }).then(res => { if (res.code == 0) { this.userInfo.gender = index[0].label + this.$u.toast('性别更新成功'); } }) }, getUserInfo() { this.$H.get("user/userInfo").then(res => { this.userInfo = res.result + this.username=res.result.username + this.intro=res.result.intro if (res.result.gender === 1) { this.userInfo.gender = '男' } else if (res.result.gender === 2) { @@ -81,8 +111,6 @@ } else { this.userInfo.gender = '保密' } - - }) }, outlogin() { @@ -140,7 +168,9 @@ padding: 20rpx; background-color: #FFFFFF; } - + .save-btn { + margin: 40rpx 30rpx; + } .out-btn { margin: 40rpx 30rpx; } diff --git a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue index d9603b6..673002a 100644 --- a/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue +++ b/src/main/resources/static/linfeng-community-uniapp-ky/pages/user/user.vue @@ -24,19 +24,19 @@ {{ userInfo.fans || 0}} - 粉丝 + 粉丝 {{ userInfo.follow || 0 }} - 关注 + 关注 {{ userInfo.postNum || 0 }} - 帖子 + 帖子 {{ userInfo.integral || 0 }} - 积分 + 积分 @@ -78,6 +78,15 @@ + + + 林风社交论坛开源版 + + + © www.linfengtech.cn + + + @@ -207,6 +216,12 @@ margin-left: 20rpx; } + .nav-text { + color: #999; + font-size: 14px; + margin-bottom: 20rpx; + } + .grid-text { color: #999; font-size: 12px; @@ -275,4 +290,20 @@ padding: 20rpx; } } + .bottom-info { + display: flex; + align-items: center; + justify-content: center; + color: #737373; + font-size: 32rpx; + font-weight: 600; + } + .bottom-info-t{ + display: flex; + align-items: center; + justify-content: center; + color: #1f1f1f; + font-size: 28rpx; + font-weight: 400; + } \ No newline at end of file