优化提交

This commit is contained in:
zhangwentao 2024-11-11 14:31:27 +08:00
parent 9acbefedbe
commit 6e4f5cfce6
6 changed files with 42 additions and 33 deletions

View File

@ -6,7 +6,7 @@
<!-- 详细信息 -->
<info-list :item="info" isDetail @mark="handleMark" @comment="handleComment" @share="handleShare"
@follow="handleFollow">
<view class="text-30 my-20 text-gray-600">
<view v-if="info.content" class="text-30 my-20 text-gray-600">
<u-parse :content="info.content"></u-parse>
</view>
</info-list>

View File

@ -106,13 +106,12 @@
},
onLoad() {
this.getUserInfo()
// this.getUserInfo()
this.getList()
this.getBannerList()
},
onShow() {
//
this.getTrainHas()
},
methods: {
async getList() {
@ -148,7 +147,7 @@
})
},
search() {
this.queryParams.page=1
this.queryParams.page = 1
this.assetList = []
this.getList()
},
@ -179,6 +178,7 @@
this.tabIndex = e.detail.current
},
btntabs(item) {
this.getTrainHas()
this.queryParams.type = item.type
this.queryParams.page = 1
this.assetList = []
@ -219,6 +219,7 @@
assetInfo({
id: item.asset_id
}).then(Response => {
uni.hideLoading()
uni.downloadFile({
url: Response.data.pdf_url,
success: function(res) {

View File

@ -695,6 +695,7 @@
title: '提交成功',
icon: 'none'
})
uni.setStorageSync('token', res.data.token);
setTimeout(() => {
uni.reLaunch({
url: '/pages/home/home'

View File

@ -5,13 +5,13 @@
</zxVideo>
</u-sticky>
<view class="detail">
<view class="title">
<view v-if="info.asset_name" class="title">
{{info.asset_name}}
</view>
<view class="desc">
<view v-if="info.digest" class="desc">
{{info.digest}}
</view>
<view class="parse">
<view v-if="info.content" class="parse">
<u-parse :content="info.content"></u-parse>
</view>
</view>

View File

@ -69,9 +69,15 @@ function codes() {
title: '提示',
content: '请先用户注册',
success: function(res) {
if (res.confirm) {
uni.reLaunch({
url: '/pages/mine/edit-info?type=register'
});
} else if (res.cancel) {
uni.navigateBack({
delta: 1
})
}
}
});
}

View File

@ -49,27 +49,28 @@ export const apiResquest = (params) => {
success: (res) => {
// 如果返回的 code 为 1表示需要重新获取 token
if (res.data.code == 1) {
if (!isRefreshing) {
isRefreshing = true; // 设置标志位
wxCode.codes().then(newToken => {
isRefreshing = false; // 请求完成,重置标志位
// 更新所有等待中的请求的 token
pendingRequests.forEach((req) => {
req.resolve({ ...res.data, token: newToken });
});
pendingRequests = []; // 清空等待中的请求
}).catch((err) => {
isRefreshing = false; // 请求失败,重置标志位
// 拒绝所有等待中的请求
pendingRequests.forEach((req) => {
req.reject(err);
});
pendingRequests = []; // 清空等待中的请求
});
// if (!isRefreshing) {
// isRefreshing = true; // 设置标志位
wxCode.codes()
// .then(newToken => {
// isRefreshing = false; // 请求完成,重置标志位
// // 更新所有等待中的请求的 token
// pendingRequests.forEach((req) => {
// req.resolve({ ...res.data, token: newToken });
// });
// pendingRequests = []; // 清空等待中的请求
// }).catch((err) => {
// isRefreshing = false; // 请求失败,重置标志位
// // 拒绝所有等待中的请求
// pendingRequests.forEach((req) => {
// req.reject(err);
// });
// pendingRequests = []; // 清空等待中的请求
// });
}
// 如果正在刷新,加入等待中的请求
return pendingRequests.push({ resolve, reject });
}
// return pendingRequests.push({ resolve, reject });
// }
resolve(res.data); // 正常返回
},