Commit 59186984 authored by liuyang's avatar liuyang

完成登陆和修改密码功能

parent 2cd01905
......@@ -78,14 +78,16 @@
this.$refs['dataForm'].validate((valid) => {
if (valid) {
this.$http({
url: this.$http.adornUrl('/sys/user/password'),
url: this.$http.adornUrl('/api/sys/user/password'),
method: 'post',
data: this.$http.adornData({
'password': this.dataForm.password,
'newPassword': this.dataForm.newPassword
})
}).then(({data}) => {
if (data && data.code === 200) {
if (data && data.errorCode) {
this.$message.error(data.message)
}else{
this.$message({
message: '操作成功',
type: 'success',
......@@ -99,9 +101,7 @@
})
}
})
} else {
this.$message.error(data.msg)
}
}
})
}
})
......
......@@ -84,14 +84,14 @@
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/sys/logout'),
method: 'post',
url: this.$http.adornUrl('/api/sys/logout'),
method: 'get',
data: this.$http.adornData()
}).then(({data}) => {
if (data && data.code === 200) {
clearLoginInfo()
this.$router.push({ name: 'login' })
}
})
}).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