From c4ee8e96a390697cd4a58ce9a0da33ecee5038c4 Mon Sep 17 00:00:00 2001 From: smallchill Date: Sat, 2 May 2020 11:35:47 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.js | 3 +++ src/views/wel/index.vue | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 2c9681b..2d8dd39 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -221,6 +221,9 @@ const user = { setStore({name: 'tenantId', content: state.tenantId, type: 'session'}) }, SET_USER_INFO: (state, userInfo) => { + if (validatenull(userInfo.avatar)) { + userInfo.avatar = "/img/bg/img-logo.png"; + } state.userInfo = userInfo; setStore({name: 'userInfo', content: state.userInfo}) }, diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue index 43f592d..5c31804 100644 --- a/src/views/wel/index.vue +++ b/src/views/wel/index.vue @@ -452,12 +452,14 @@ import {registerGuest} from "@/api/user"; import {getTopUrl} from "@/util/util"; import {info} from "@/api/system/tenant"; + import {validatenull} from "@/util/validate"; export default { name: "wel", data() { return { form: { + tenantId: '', name: '', account: '', password: '', @@ -478,7 +480,7 @@ }, mounted() { // 若未登录则弹出框进行绑定 - if (this.userInfo.user_id === undefined || this.userInfo.user_id < 0) { + if (validatenull(this.userInfo.user_id) || this.userInfo.user_id < 0) { this.form.name = this.userInfo.user_name; this.form.account = this.userInfo.user_name; this.accountBox = true; @@ -512,6 +514,9 @@ } else { this.$message.error(data.msg || '提交失败'); } + }, error => { + window.console.log(error); + this.loading = false; }); }, getTenant() {