Browse Source

退出增加确认对话框,首页显示优化。

程志平 3 years ago
parent
commit
3e3a0323f9
2 changed files with 18 additions and 3 deletions
  1. 17 2
      src/layout/components/Navbar.vue
  2. 1 1
      src/views/index/index.vue

+ 17 - 2
src/layout/components/Navbar.vue

@@ -102,8 +102,23 @@
 			},
 			},
 			// 退出登录
 			// 退出登录
 			async logout() {
 			async logout() {
-				await this.$store.dispatch('user/logout')
-				this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+				await this.$confirm('即将退出登录, 是否继续?', '提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					type: 'warning'
+				}).then(() => {
+					this.$store.dispatch('user/logout')
+					this.$router.push(`/login?redirect=${this.$route.fullPath}`)
+					this.$message({
+						type: 'success',
+						message: '已退出成功!'
+					});
+				}).catch(() => {
+					this.$message({
+						type: 'error',
+						message: '已取消退出!'
+					});
+				});
 			},
 			},
 			// 获取当前日期时间星期
 			// 获取当前日期时间星期
 			get_datetime() {
 			get_datetime() {

+ 1 - 1
src/views/index/index.vue

@@ -538,7 +538,7 @@
 
 
 					if (res.code == 200) {
 					if (res.code == 200) {
 						this.showThisMonthRecharge.time = res.time
 						this.showThisMonthRecharge.time = res.time
-						this.showThisMonthRecharge.amount = res.zongCo.tong
+						this.showThisMonthRecharge.amount = res.zongRe.tong
 					} else if (res.code == 205) {
 					} else if (res.code == 205) {
 						this.showThisMonthRecharge.time = getFormatDateTime('datetime');
 						this.showThisMonthRecharge.time = getFormatDateTime('datetime');
 						// this.$message.error('本月充值:' + res.message)
 						// this.$message.error('本月充值:' + res.message)