提交 8620ddb2 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 be989434
......@@ -114,11 +114,7 @@ export default {
this.passport.checkLoginStatus((isLogin, user = {}) => {
this.isLogin = isLogin
this.user = user
if (this.$route.path === '/card') {
window.location.href = this.$route.fullPath
} else {
this.$router.push('/my')
}
window.location.href = this.$route.path
})
}
}
......
......@@ -14,7 +14,7 @@
<upload-image v-model="form.avatar"></upload-image>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleSubmit">保存</el-button>
<el-button type="primary" @click="handleSubmit">提交</el-button>
</el-form-item>
</el-form>
</div>
......@@ -44,21 +44,21 @@ export default {
},
getAvatar() {
getAvatar().then(res => {
if (res.status === 200 && res.code === 0) {
this.form = res.date
} else if (res.status === 400) {
if (res.status === 400) {
this.$message.error(res.message)
} else if (res.status === 403) {
this.$router.push({ path: '/index', query: { needLogin: Date.now() } })
this.$router.push({ query: { needLogin: Date.now() } })
} else {
this.form = res.date
}
})
},
uploadAvatar() {
uploadAvatar({ avatar: this.form.avatar }).then(res => {
if (res.status === 200 && res.code === 0) {
this.$message({ type: 'success', message: '保存成功' })
} else {
if (res.status) {
this.$message.error(res.message)
} else {
this.$message({ type: 'success', message: '提交成功' })
}
})
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论