|
@@ -4,7 +4,7 @@
|
|
<view class="index-header-box">
|
|
<view class="index-header-box">
|
|
<view class="index-header-box-1">
|
|
<view class="index-header-box-1">
|
|
<view class="left">
|
|
<view class="left">
|
|
- <text>欢迎你!{{ userInfo.nickname }}</text>
|
|
|
|
|
|
+ <text>欢迎你!{{ vuex_user.operName }}</text>
|
|
</view>
|
|
</view>
|
|
<view class="right">
|
|
<view class="right">
|
|
<u-icon size="21" name="../../static/icons/logout-icon.svg" @click="logout"></u-icon>
|
|
<u-icon size="21" name="../../static/icons/logout-icon.svg" @click="logout"></u-icon>
|
|
@@ -72,9 +72,7 @@
|
|
export default {
|
|
export default {
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- userInfo: {
|
|
|
|
- nickname: 'XXX'
|
|
|
|
- },
|
|
|
|
|
|
+ todayData: {},
|
|
analysisMenuList: [{
|
|
analysisMenuList: [{
|
|
icon: require('@/static/icons/today-overview-icon.svg'),
|
|
icon: require('@/static/icons/today-overview-icon.svg'),
|
|
name: '今日概况',
|
|
name: '今日概况',
|
|
@@ -147,7 +145,8 @@
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
-
|
|
|
|
|
|
+ // 为了验证token是否过期
|
|
|
|
+ this.getTodayData();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
/**
|
|
/**
|
|
@@ -160,7 +159,6 @@
|
|
success: (res) => {
|
|
success: (res) => {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
uni.$u.api.logoutApi().then(res => {
|
|
uni.$u.api.logoutApi().then(res => {
|
|
- console.log(res)
|
|
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
uni.$u.vuex('vuex_token', '');
|
|
uni.$u.vuex('vuex_token', '');
|
|
this.$u.vuex('vuex_user', {});
|
|
this.$u.vuex('vuex_user', {});
|
|
@@ -176,7 +174,23 @@
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- });
|
|
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ /**
|
|
|
|
+ * 获取今日概况
|
|
|
|
+ */
|
|
|
|
+ getTodayData() {
|
|
|
|
+ uni.$u.api.todayOverviewApi.getTodayDataApi().then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.todayData = res.data
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.uToast.show({
|
|
|
|
+ loading: true,
|
|
|
|
+ message: res.msg || '获取今日概况失败!',
|
|
|
|
+ type: 'error'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 跳转页面
|
|
* 跳转页面
|