Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
xyxBooking-weapp
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2026-01-07 21:28:37 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4b0fc1d74628021a5177ef0629c864cd93c9fefb
4b0fc1d7
1 parent
9e928421
fix: 添加弱网超时处理并跳转弱网页面
在初始化二维码列表时添加5秒超时判定,超时后跳转至弱网页面
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
src/components/qrCode.vue
src/components/qrCode.vue
View file @
4b0fc1d
<!--
* @Date: 2024-01-16 10:06:47
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-07 2
0:54:13
* @LastEditTime: 2026-01-07 2
1:25:49
* @FilePath: /xyxBooking-weapp/src/components/qrCode.vue
* @Description: 预约码卡组件
-->
...
...
@@ -169,7 +169,12 @@ const formatGroup = (data) => {
const init = async () => {
if (!props.type) {
try {
const { code, data } = await qrcodeListAPI();
// TAG: 设置 5s 超时判定为弱网
const timeoutPromise = new Promise((_, reject) => {
setTimeout(() => reject(new Error('TIMEOUT')), 5000);
});
const { code, data } = await Promise.race([qrcodeListAPI(), timeoutPromise]);
if (code) {
data.forEach(item => {
...
...
@@ -193,6 +198,10 @@ const init = async () => {
}
} catch (err) {
console.error('Fetch QR List Failed:', err);
// 如果是超时,跳转弱网页面
if (err.message === 'TIMEOUT') {
go('/pages/weakNetwork/index');
}
}
} else {
if (props.payId) {
...
...
Please
register
or
login
to post a comment