用户编辑前端修改等
This commit is contained in:
parent
6e14f98912
commit
247ca3e65d
21
src/main/java/io/linfeng/common/utils/ObjectUtil.java
Normal file
21
src/main/java/io/linfeng/common/utils/ObjectUtil.java
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package io.linfeng.common.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 对象工具类
|
||||||
|
* @author linfeng
|
||||||
|
* @date 2022/11/4 9:49
|
||||||
|
*/
|
||||||
|
public class ObjectUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Title: isEmpty
|
||||||
|
* @Description: 判断对象是否为空
|
||||||
|
* @param obj
|
||||||
|
* @return
|
||||||
|
* @return Integer
|
||||||
|
*/
|
||||||
|
public static boolean isEmpty(Object obj) {
|
||||||
|
return null == obj || "".equals(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -74,14 +74,5 @@ public class WechatUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @Title: isEmpty
|
|
||||||
* @Description: 判断对象是否为空
|
|
||||||
* @param obj
|
|
||||||
* @return
|
|
||||||
* @return Integer
|
|
||||||
*/
|
|
||||||
public static boolean isEmpty(Object obj) {
|
|
||||||
return null == obj || "".equals(obj);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
QueryWrapper<AppUserEntity> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<AppUserEntity> queryWrapper = new QueryWrapper<>();
|
||||||
//模糊查询
|
//模糊查询
|
||||||
String key = (String) params.get("key");
|
String key = (String) params.get("key");
|
||||||
if (!WechatUtil.isEmpty(key)) {
|
if (!ObjectUtil.isEmpty(key)) {
|
||||||
params.put("page", "1");//如果是查询分页重置为第一页
|
params.put("page", "1");//如果是查询分页重置为第一页
|
||||||
queryWrapper.like("username", key).or().like("mobile", key);
|
queryWrapper.like("username", key).or().like("mobile", key);
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateAppUserInfo(AppUserUpdateForm appUserUpdateForm, AppUserEntity user) {
|
public void updateAppUserInfo(AppUserUpdateForm appUserUpdateForm, AppUserEntity user) {
|
||||||
if (!WechatUtil.isEmpty(appUserUpdateForm.getAvatar())) {
|
if (!ObjectUtil.isEmpty(appUserUpdateForm.getAvatar())) {
|
||||||
user.setAvatar(appUserUpdateForm.getAvatar());
|
user.setAvatar(appUserUpdateForm.getAvatar());
|
||||||
}
|
}
|
||||||
baseMapper.updateById(user);
|
baseMapper.updateById(user);
|
||||||
@ -313,8 +313,6 @@ public class AppUserServiceImpl extends ServiceImpl<AppUserDao, AppUserEntity> i
|
|||||||
//新注册用户
|
//新注册用户
|
||||||
AppUserEntity appUser = new AppUserEntity();
|
AppUserEntity appUser = new AppUserEntity();
|
||||||
appUser.setGender(0);
|
appUser.setGender(0);
|
||||||
// appUser.setAvatar(form.getAvatar());
|
|
||||||
// appUser.setUsername(form.getUsername());
|
|
||||||
appUser.setAvatar(Constant.DEAULT_HEAD);
|
appUser.setAvatar(Constant.DEAULT_HEAD);
|
||||||
appUser.setUsername("LF_wx" + RandomUtil.randomNumbers(8));
|
appUser.setUsername("LF_wx" + RandomUtil.randomNumbers(8));
|
||||||
appUser.setCreateTime(DateUtil.nowDateTime());
|
appUser.setCreateTime(DateUtil.nowDateTime());
|
||||||
|
@ -63,11 +63,11 @@ public class PostServiceImpl extends ServiceImpl<PostDao, PostEntity> implements
|
|||||||
//条件查询
|
//条件查询
|
||||||
String key = (String)params.get("key");
|
String key = (String)params.get("key");
|
||||||
String status = (String)params.get("status");
|
String status = (String)params.get("status");
|
||||||
if(!WechatUtil.isEmpty(key)){
|
if(!ObjectUtil.isEmpty(key)){
|
||||||
params.put("page","1");//如果是查询分页重置为第一页
|
params.put("page","1");//如果是查询分页重置为第一页
|
||||||
queryWrapper.like("content", key).or().like("title",key);
|
queryWrapper.like("content", key).or().like("title",key);
|
||||||
}
|
}
|
||||||
if(!WechatUtil.isEmpty(status)){
|
if(!ObjectUtil.isEmpty(status)){
|
||||||
params.put("page","1");//如果是查询分页重置为第一页
|
params.put("page","1");//如果是查询分页重置为第一页
|
||||||
queryWrapper.eq("status", Integer.parseInt(status));
|
queryWrapper.eq("status", Integer.parseInt(status));
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,6 @@
|
|||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的"
|
"navigationBarTitleText": "我的"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "pages/message/message",
|
|
||||||
"style": {
|
|
||||||
"enablePullDownRefresh": true,
|
|
||||||
"navigationBarTitleText": "消息"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
,{
|
,{
|
||||||
"path" : "pages/post/post",
|
"path" : "pages/post/post",
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
<template>
|
|
||||||
<view>
|
|
||||||
消息
|
|
||||||
</view>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
@ -10,17 +10,16 @@
|
|||||||
:disabled="true" input-align="right" />
|
:disabled="true" input-align="right" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="性别" right-icon="arrow-right">
|
<u-form-item label="性别" right-icon="arrow-right">
|
||||||
<u-input @click="showGender = true" :placeholder="userInfo.gender"
|
<u-input @click="showGender = true" :placeholder="userInfo.gender" :disabled="true"
|
||||||
:disabled="true" input-align="right" />
|
input-align="right" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
<u-form-item label="个性签名" right-icon="arrow-right">
|
<u-form-item label="个性签名" right-icon="arrow-right">
|
||||||
<u-input @click="jump(userInfo.intro,'intro')" :placeholder="userInfo.intro" :disabled="true"
|
<u-input @click="jump(userInfo.intro,'intro')" :placeholder="userInfo.intro" :disabled="true"
|
||||||
input-align="right" />
|
input-align="right" />
|
||||||
</u-form-item>
|
</u-form-item>
|
||||||
|
|
||||||
</u-form>
|
</u-form>
|
||||||
</view>
|
</view>
|
||||||
<view>
|
<view class="out-btn">
|
||||||
<u-button :custom-style="btnStyle" @click="outlogin">退出登录</u-button>
|
<u-button :custom-style="btnStyle" @click="outlogin">退出登录</u-button>
|
||||||
</view>
|
</view>
|
||||||
<!-- 性别选择 -->
|
<!-- 性别选择 -->
|
||||||
@ -39,8 +38,7 @@
|
|||||||
form: {},
|
form: {},
|
||||||
userInfo: {},
|
userInfo: {},
|
||||||
showGender: false,
|
showGender: false,
|
||||||
gender:[
|
gender: [{
|
||||||
{
|
|
||||||
value: 1,
|
value: 1,
|
||||||
label: "男"
|
label: "男"
|
||||||
},
|
},
|
||||||
@ -61,13 +59,12 @@
|
|||||||
methods: {
|
methods: {
|
||||||
// 修改性别
|
// 修改性别
|
||||||
saveGender(index) {
|
saveGender(index) {
|
||||||
let gender = this.gender[index[0]].value;
|
let gender = index[0].value;
|
||||||
|
|
||||||
this.$H.post("user/userInfoEdit", {
|
this.$H.post("user/userInfoEdit", {
|
||||||
gender: gender
|
gender: gender
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
this.userInfo.gender = this.gender[index[0]].lable
|
this.userInfo.gender = index[0].label
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -146,5 +143,7 @@
|
|||||||
background-color: #FFFFFF;
|
background-color: #FFFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.out-btn {
|
||||||
|
margin: 40rpx 30rpx;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user