Commit 59186984 authored by liuyang's avatar liuyang

完成登陆和修改密码功能

parent 2cd01905
...@@ -78,14 +78,16 @@ ...@@ -78,14 +78,16 @@
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/user/password'), url: this.$http.adornUrl('/api/sys/user/password'),
method: 'post', method: 'post',
data: this.$http.adornData({ data: this.$http.adornData({
'password': this.dataForm.password, 'password': this.dataForm.password,
'newPassword': this.dataForm.newPassword 'newPassword': this.dataForm.newPassword
}) })
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 200) { if (data && data.errorCode) {
this.$message.error(data.message)
}else{
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
type: 'success', type: 'success',
...@@ -99,9 +101,7 @@ ...@@ -99,9 +101,7 @@
}) })
} }
}) })
} else { }
this.$message.error(data.msg)
}
}) })
} }
}) })
......
...@@ -84,14 +84,14 @@ ...@@ -84,14 +84,14 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/logout'), url: this.$http.adornUrl('/api/sys/logout'),
method: 'post', method: 'get',
data: this.$http.adornData() data: this.$http.adornData()
}).then(({data}) => { }).then(({data}) => {
if (data && data.code === 200) {
clearLoginInfo() clearLoginInfo()
this.$router.push({ name: 'login' }) this.$router.push({ name: 'login' })
}
}) })
}).catch(() => {}) }).catch(() => {})
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment