|
|
@@ -52,10 +52,10 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="error-section">
|
|
|
-<!-- <div class="error-display">-->
|
|
|
-<!-- <div class="error-label">错误数量</div>-->
|
|
|
-<!-- <div class="error-count">{{ errNum }}</div>-->
|
|
|
-<!-- </div>-->
|
|
|
+ <div class="error-display">
|
|
|
+ <div class="error-label" @click="logout">退出登录</div>
|
|
|
+ <!-- <div class="error-count">{{ errNum }}</div>-->
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
</van-col>
|
|
|
@@ -147,7 +147,7 @@ import { onMounted, onUnmounted, ref, watch } from 'vue'
|
|
|
import { closeListener, openListener, scanInit } from '@/utils/keydownListener'
|
|
|
import { scanSuccess, scanError } from '@/utils/android'
|
|
|
import { getVersionName, checkUpdate, saveUserId, getUserId, scanRepeat, saveMacAddress, listErrRecords, reLoginTip,
|
|
|
- readMacAddress, pageDelivery, addDelivery, isDeliveryNoExists, markAsPushed, getErrRecordsCount } from '@/utils/androidPiece'
|
|
|
+ readMacAddress, pageDelivery, addDelivery, isDeliveryNoExists, markAsPushed, getErrRecordsCount, removeUserId } from '@/utils/androidPiece'
|
|
|
import { showLoadingToast, showNotify } from 'vant'
|
|
|
import { getUserIdByCert, getUserNameById } from '@/api/login/index'
|
|
|
import { receive, getScanDriverInfo } from '@/api/scan/index'
|
|
|
@@ -185,6 +185,18 @@ const updateNetworkStatus = () => {
|
|
|
isOnline.value = navigator.onLine
|
|
|
}
|
|
|
|
|
|
+// 退出登录
|
|
|
+const logout = () => {
|
|
|
+ if (!userInfo.value.userId) {
|
|
|
+ scanError()
|
|
|
+ showNotify({ type: 'danger', style: 'font-size: 30px !important;height:50px', message: '请先登录!' });
|
|
|
+ return
|
|
|
+ }
|
|
|
+ userInfo.value = {}
|
|
|
+ removeUserId()
|
|
|
+ scanSuccess()
|
|
|
+ showNotify({ type: 'success', style: 'font-size: 30px !important;height:50px', message: '已退出登录!' });
|
|
|
+}
|
|
|
|
|
|
// 网络提示
|
|
|
const showReconnected = ref(false)
|
|
|
@@ -837,23 +849,17 @@ span
|
|
|
padding-left: 8px
|
|
|
|
|
|
.error-section
|
|
|
- margin-top: auto
|
|
|
- padding-top: 10px
|
|
|
- padding-bottom: 30px
|
|
|
- border-top: 1px dashed #e0e0e0
|
|
|
+ padding-bottom: 25px
|
|
|
|
|
|
.error-display
|
|
|
- display: flex
|
|
|
- justify-content: space-between
|
|
|
- align-items: center
|
|
|
background: #fff5f5
|
|
|
- padding: 12px 15px
|
|
|
- border-radius: 8px
|
|
|
- box-shadow: 0 2px 8px rgba(0,0,0,0.05)
|
|
|
+ padding: 3px 4px
|
|
|
+ border-radius: 3px
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1)
|
|
|
|
|
|
.error-label
|
|
|
- font-size: 7px
|
|
|
- color: #7f8c8d
|
|
|
+ font-size: 8px
|
|
|
+ color: #778181
|
|
|
|
|
|
.error-count
|
|
|
font-size: 10px
|