🎉 2.5.2.RELEASE 增加个人中心

This commit is contained in:
smallchill 2019-10-20 22:36:19 +08:00
parent 8404dc9ac9
commit cf5017721b
6 changed files with 154 additions and 102 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<img src="https://img.shields.io/badge/Release-V2.5.1-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/Release-V2.5.2-green.svg" alt="Downloads">
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
<img src="https://img.shields.io/badge/Spring%20Cloud-Greenwich.SR3-blue.svg" alt="Coverage Status">
@ -65,7 +65,7 @@ SpringBlade
* Archer-全能代码生成系统:[https://archer.bladex.vip](https://archer.bladex.vip)
## 技术文档
* [开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
* [SpringBlade开发手册一览](https://gitee.com/smallc/SpringBlade/wikis/SpringBlade开发手册)
* [常见问题集锦](https://sns.bladex.vip/article-14966.html)
## 项目地址

View File

@ -1,6 +1,6 @@
{
"name": "saber-admin",
"version": "2.5.1",
"version": "2.5.2",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",

View File

@ -1,14 +1,5 @@
import request from '@/router/axios';
export const resetPassword = (userIds) => {
return request({
url: '/api/blade-user/reset-password',
method: 'post',
params: {
userIds,
}
})
}
export const getList = (current, size, params) => {
return request({
url: '/api/blade-user/list',
@ -55,3 +46,33 @@ export const getUser = (id) => {
}
})
}
export const getUserInfo = () => {
return request({
url: '/api/blade-user/info',
method: 'get',
})
}
export const resetPassword = (userIds) => {
return request({
url: '/api/blade-user/reset-password',
method: 'post',
params: {
userIds,
}
})
}
export const updatePassword = (oldPassword, newPassword, newPassword1) => {
return request({
url: '/api/blade-user/update-password',
method: 'post',
params: {
oldPassword,
newPassword,
newPassword1,
}
})
}

View File

@ -1,74 +1,72 @@
export default {
column: [{
label: '个人信息',
prop: 'info',
option: {
submitText: '修改',
column: [{
label: '头像',
type: 'upload',
listType: 'picture-img',
propsHttp: {
res: 'data.0'
},
canvasOption: {
text: 'avue',
ratio: 0.1
},
action: 'https://avueupload.91eic.com/upload/list',
tip: '只能上传jpg/png用户头像且不超过500kb',
span: 12,
row: true,
prop: 'img'
}, {
label: '姓名',
span: 6,
row: true,
prop: 'name'
}, {
label: '用户名',
span: 12,
row: true,
prop: 'username'
}, {
label: '手机号',
span: 12,
row: true,
prop: 'phone'
}, {
label: '个性签名',
prop: 'detail',
span: 24,
row: true,
type: 'textarea',
minRows: 5,
maxRows: 8,
}]
}
}, {
label: '修改密码',
prop: 'password',
option: {
submitText: '修改',
column: [{
label: '原密码',
span: 12,
row: true,
type: 'password',
prop: 'oldpassword'
}, {
label: '新密码',
span: 12,
row: true,
type: 'password',
prop: 'newpassword'
}, {
label: '确认密码',
span: 12,
row: true,
type: 'password',
prop: 'newpasswords'
}]
}
}]
}
column: [{
label: '个人信息',
prop: 'info',
option: {
submitText: '修改',
column: [{
label: '头像',
type: 'upload',
listType: 'picture-img',
propsHttp: {
res: 'data',
url: 'link',
},
canvasOption: {
text: 'blade',
ratio: 0.1
},
action: '/api/blade-resource/oss/endpoint/put-file',
tip: '只能上传jpg/png用户头像且不超过500kb',
span: 12,
row: true,
prop: 'avatar'
}, {
label: '姓名',
span: 12,
row: true,
prop: 'name'
}, {
label: '用户名',
span: 12,
row: true,
prop: 'realName'
}, {
label: '手机号',
span: 12,
row: true,
prop: 'phone'
}, {
label: '邮箱',
prop: 'email',
span: 12,
row: true,
}]
}
}, {
label: '修改密码',
prop: 'password',
option: {
submitText: '修改',
column: [{
label: '原密码',
span: 12,
row: true,
type: 'password',
prop: 'oldPassword'
}, {
label: '新密码',
span: 12,
row: true,
type: 'password',
prop: 'newPassword'
}, {
label: '确认密码',
span: 12,
row: true,
type: 'password',
prop: 'newPassword1'
}]
}
}]
}

View File

@ -11,6 +11,8 @@
<script>
import option from "@/const/user/info";
import {getUserInfo, update, updatePassword} from "@/api/system/user";
export default {
data() {
@ -25,25 +27,49 @@
},
methods: {
handleSubmit() {
this.$message({
message: this.form,
type: "success"
});
if (this.type === "info") {
update(this.form).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改信息成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
})
} else {
updatePassword(this.form.oldPassword, this.form.newPassword, this.form.newPassword1).then(res => {
if (res.data.success) {
this.$message({
type: "success",
message: "修改密码成功!"
});
} else {
this.$message({
type: "error",
message: res.data.msg
});
}
})
}
},
handleWitch() {
if (this.type === "info") {
this.form = {
username: "smallwei",
name: "smallwei",
phone: "1888888888888",
detail: "这是一个个性签名"
};
} else if (this.type === "password") {
this.form = {
oldpassword: 11111111,
newpassword: 22222222,
newpasswords: 22222222
};
getUserInfo().then(res => {
const user = res.data.data;
this.form = {
id: user.id,
avatar: user.avatar,
name: user.name,
realName: user.realName,
phone: user.phone,
email: user.email,
}
});
}
},
handleChange(item) {

View File

@ -75,6 +75,13 @@
</el-col>
<el-col :span="8">
<el-collapse v-model="logActiveNames" @change="handleChange">
<el-collapse-item title="2.5.2发布 增加个人中心" name="11">
<div>1.增加个人中心支持用户信息自定义修改</div>
<div>2.增加网关鉴权配置示例</div>
<div>3.token的SIGN_KEY修改为一致</div>
<div>4.admin模块增加对seata服务的过滤</div>
<div>5.blade-tool增加部分工具类方法</div>
</el-collapse-item>
<el-collapse-item title="2.5.1发布 增加动态网关鉴权" name="10">
<div>1.增加网关动态鉴权</div>
<div>2.secure安全模块token校验默认关闭交由网关处理</div>
@ -177,7 +184,7 @@
data() {
return {
activeNames: ['1', '2', '3'],
logActiveNames: ['10']
logActiveNames: ['11']
};
},
computed: {