Commit f00f63e0 authored by Facius's avatar Facius

超级用户

parent 859346a5
...@@ -17,11 +17,13 @@ ...@@ -17,11 +17,13 @@
<u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon> <u-icon class="tel-arrow-icon" name="arrow-up-fill"></u-icon>
</view> </view>
</view> </view>
<view v-if="isSuperuser" class="super-button"><u-button@click="$u.throttle(handleSuperButton, 500)">切换用户</u-button></view>
</view> </view>
<view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)"> <view class="header-right-view" @click="$u.throttle(handleClickSetting, 500)">
<image :src="shezhiImage" class="right-image-view"></image> <view class="setting-view">
<text>设置</text> <image :src="shezhiImage" class="right-image-view"></image>
<text>设置</text>
</view>
<view v-if="isSuperuser" class="super-button"><u-button@click="handleSuperButton">切换用户</u-button></view>
</view> </view>
</view> </view>
<view class="ware-house-view"> <view class="ware-house-view">
...@@ -185,6 +187,13 @@ ...@@ -185,6 +187,13 @@
isSuperuser() { isSuperuser() {
return this.vuex_superuser return this.vuex_superuser
} }
},
watch: {
vuex_token(val, oldVal) {
if (val && !this.isSuperuser) {
this.allowLogin()
}
},
}, },
onLoad() { onLoad() {
app.trackPage('我的首页') app.trackPage('我的首页')
...@@ -327,22 +336,25 @@ ...@@ -327,22 +336,25 @@
} }
} }
} }
.super-button {
margin-left: 20rpx;
}
} }
.header-right-view { .header-right-view {
display: flex; .setting-view {
justify-content: flex-end; display: flex;
align-items: center; justify-content: flex-end;
color: #FFFFFF; align-items: center;
margin-right: 4rpx; color: #FFFFFF;
font-size: 26rpx; margin-right: 4rpx;
margin-top: -24rpx; font-size: 26rpx;
.right-image-view { margin-top: -24rpx;
width: 34rpx; .right-image-view {
height: 32rpx; width: 34rpx;
margin-right: 10rpx; height: 32rpx;
margin-right: 10rpx;
}
}
.super-button {
margin-top: 20rpx;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment