瀏覽代碼

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

程志平 3 年之前
父節點
當前提交
3e3a0323f9
共有 2 個文件被更改,包括 18 次插入3 次删除
  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() {
-				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() {

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

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