接口节流优化

This commit is contained in:
仲么了
2023-08-31 16:14:15 +08:00
parent 14c7eb5bb1
commit fb5de4370b
4 changed files with 20 additions and 11 deletions

View File

@@ -40,7 +40,7 @@ export default (options = {}) => {
if (arr.indexOf(options.url) > -1) {
setTimeout(() => {
arr.splice(arr.indexOf(options.url), 1)
}, 300)
}, 1500)
}
if (res.data.resultCode !== 10000 && res.data.code !== 'A0000') {
errHandler(res.data)
@@ -53,7 +53,7 @@ export default (options = {}) => {
if (arr.indexOf(options.url) > -1) {
setTimeout(() => {
arr.splice(arr.indexOf(options.url), 1)
}, 300)
}, 1500)
}
reject(err)
uni.showToast({

View File

@@ -32,7 +32,6 @@
<template v-for="(item,index) in IOData">
<view class="item">{{ item.clDid }}</view>
<view class="item">
<!-- <view class="status-point-success mr10"></view>-->
<view style="width: 30rpx"> {{ item.value || '-'}}</view>
<view v-if="item.value"> °C</view>
</view>
@@ -467,6 +466,7 @@ export default {
width: 110rpx;
font-size: 16rpx;
opacity: 0.8;
.grid-card-content-2,
.grid-card-content-1 {
font-size: 16rpx;
@@ -484,6 +484,7 @@ export default {
right: 10rpx;
width: 200rpx;
opacity: 0.8;
.grid-card-content-2,
.grid-card-content-1 {
font-size: 16rpx;

View File

@@ -46,6 +46,7 @@ export default {
onLoad(options) {
this.options = options
this.engineeringList = uni.getStorageSync('engineeringList')
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
},
onShow() {
queryEngineering().then(res => {
@@ -53,9 +54,16 @@ export default {
})
},
onNavigationBarButtonTap(e) {
if (this.userInfo.authorities === 'app_vip_user' || this.userInfo.authorities === 'engineering_user') {
uni.navigateTo({
url: '/pages/engineering/new',
url: `/pages/engineering/new`,
})
} else {
uni.showToast({
title: '暂无权限',
icon: 'none',
})
}
},
methods: {
confirm(e) {

View File

@@ -176,7 +176,7 @@ export default {
this.formData.tempFiles.push(item)
} else {
this.formData.files.push({
url: this.$config.static + item.filePath,
url: item.filePath,
extname: item.name.split('.')[1],
name: item.name,
...item,