rev:个人信息修改
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
dtl.*
|
||||
FROM
|
||||
sch_base_task task
|
||||
LEFT JOIN st_ivt_structattr sa ON (sa.struct_code = task.point_code2 OR sa.struct_code = task.point_code1)
|
||||
LEFT JOIN st_ivt_structattr sa ON (sa.struct_code = task.point_code3 OR sa.struct_code = task.point_code1)
|
||||
LEFT JOIN st_ivt_checkdtl_bcp dtl ON dtl.struct_id = sa.struct_id
|
||||
LEFT JOIN st_ivt_checkmst_bcp mst ON mst.check_id = dtl.check_id
|
||||
<where>
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.nl.wms.system_manage.controller.user;
|
||||
|
||||
import cn.dev33.satoken.secure.SaSecureUtil;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
@@ -82,12 +83,12 @@ public class UserController {
|
||||
|
||||
@Log("修改用户:个人中心")
|
||||
//("修改用户:个人中心")
|
||||
// @PutMapping(value = "center")
|
||||
@PutMapping(value = "center")
|
||||
public ResponseEntity<Object> center(@RequestBody SysUser resources){
|
||||
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsLong())){
|
||||
if(!resources.getUser_id().equals(StpUtil.getLoginIdAsString())){
|
||||
throw new BadRequestException("不能修改他人资料");
|
||||
}
|
||||
userService.saveOrUpdate(resources);
|
||||
userService.update(JSON.parseObject(JSON.toJSONString(resources)));
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<ul class="user-info">
|
||||
<li><div style="height: 100%"><svg-icon icon-class="login" /> 登录账号<div class="user-right">{{ user.username }}</div></div></li>
|
||||
<li><svg-icon icon-class="user1" /> 用户姓名 <div class="user-right">{{ user.personName }}</div></li>
|
||||
<li><svg-icon icon-class="user1" /> 用户姓名 <div class="user-right">{{ user.person_name }}</div></li>
|
||||
<li><svg-icon icon-class="dept" /> 所属部门
|
||||
<el-tooltip effect="dark" placement="top">
|
||||
<div slot="content">
|
||||
@@ -123,7 +123,7 @@ import store from '@/store'
|
||||
import { isvalidPhone } from '@/utils/validate'
|
||||
import { parseTime } from '@/utils/index'
|
||||
import crud from '@/mixins/crud'
|
||||
import { editUser } from '@/views/system/user'
|
||||
import { editUser } from '@/views/system/user/user'
|
||||
import Avatar from '@/assets/images/avatar.png'
|
||||
export default {
|
||||
name: 'Center',
|
||||
@@ -170,7 +170,7 @@ export default {
|
||||
])
|
||||
},
|
||||
created() {
|
||||
this.form = { id: this.user.id, personName: this.user.personName, gender: this.user.gender, phone: this.user.phone }
|
||||
this.form = { id: this.user.id, personName: this.user.person_name, gender: this.user.gender, phone: this.user.phone }
|
||||
store.dispatch('GetInfo').then(() => {})
|
||||
},
|
||||
methods: {
|
||||
@@ -195,7 +195,10 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveLoading = true
|
||||
editUser(this.form).then(() => {
|
||||
this.user.person_name = this.form.personName
|
||||
this.user.gender = this.form.gender
|
||||
this.user.phone = this.form.phone
|
||||
editUser(this.user).then(() => {
|
||||
this.editSuccessNotify()
|
||||
store.dispatch('GetInfo').then(() => {})
|
||||
this.saveLoading = false
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { validEmail } from '@/utils/validate'
|
||||
import { updateEmail } from '@/views/system/user'
|
||||
import { updateEmail } from '@/views/system/user/user'
|
||||
import { resetEmail } from '@/api/system/code'
|
||||
export default {
|
||||
props: {
|
||||
@@ -93,6 +93,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
this.form.code = '1'
|
||||
updateEmail(this.form).then(res => {
|
||||
this.loading = false
|
||||
this.resetForm()
|
||||
|
||||
Reference in New Issue
Block a user