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-16 16:15:11 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e85c34367442a073865c9006f909ff95a7b19d1e
e85c3436
1 parent
3cd70e18
fix: 移除重复的错误提示并优化API错误处理
移除提交、核销和删除操作中的重复错误提示 优化API错误处理逻辑,统一使用fn.js中的错误提示
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
12 deletions
src/api/fn.js
src/pages/submit/index.vue
src/pages/verificationResult/index.vue
src/pages/visitorList/index.vue
src/api/fn.js
View file @
e85c343
/*
* @Date: 2022-05-18 22:56:08
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-
06 20:56:55
* @FilePath: /
git/
xyxBooking-weapp/src/api/fn.js
* @LastEditTime: 2026-01-
16 15:51:34
* @FilePath: /xyxBooking-weapp/src/api/fn.js
* @Description: 文件描述
*/
import
axios
from
'@/utils/request'
;
...
...
@@ -18,11 +18,11 @@ export const fn = (api) => {
return
api
.
then
(
res
=>
{
// 适配 H5 逻辑,code === 1 为成功
if
(
res
.
data
.
code
==
=
1
)
{
if
(
res
.
data
.
code
==
1
)
{
return
res
.
data
||
true
;
}
else
{
// tslint:disable-next-line: no-console
console
.
warn
(
res
);
console
.
warn
(
'API Error:'
,
res
);
if
(
res
.
data
.
show
===
false
)
return
false
;
Taro
.
showToast
({
title
:
res
.
data
.
msg
||
'请求失败'
,
...
...
src/pages/submit/index.vue
View file @
e85c343
<!--
* @Date: 2024-01-15 16:25:51
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-16 1
5:12:09
* @LastEditTime: 2026-01-16 1
6:13:44
* @FilePath: /xyxBooking-weapp/src/pages/submit/index.vue
* @Description: 预约人员信息
-->
...
...
@@ -145,7 +145,6 @@ const submitBtn = async () => {
Taro.hideLoading();
if (!code || code !== 1) {
Taro.showToast({ title: msg || '提交失败', icon: 'none' });
return;
}
pay_id = data.pay_id;
...
...
src/pages/verificationResult/index.vue
View file @
e85c343
<!--
* @Date: 2026-01-08 13:01:20
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2026-01-1
5 16:49:25
* @LastEditTime: 2026-01-1
6 16:14:06
* @FilePath: /xyxBooking-weapp/src/pages/verificationResult/index.vue
* @Description: 核销结果页面
-->
...
...
@@ -110,7 +110,6 @@ const verify_ticket = async (code) => {
}
verify_status.value = 'fail'
msg.value = res?.msg || '核销失败'
Taro.showToast({ title: msg.value, icon: 'none' })
} catch (e) {
verify_status.value = 'fail'
msg.value = '核销失败'
...
...
src/pages/visitorList/index.vue
View file @
e85c343
...
...
@@ -93,12 +93,10 @@ const removeItem = async (item) => {
const { confirm } = await Taro.showModal({ title: '提示', content: '确定删除该参观者吗?' });
if (confirm) {
try {
const
{ code, msg }
= await delPersonAPI({ person_id: item.id });
if (code) {
const
res
= await delPersonAPI({ person_id: item.id });
if (
res && res.
code) {
Taro.showToast({ title: '删除成功' });
loadList();
} else {
Taro.showToast({ title: msg || '删除失败', icon: 'none' });
}
} catch (error) {
console.error(error);
...
...
Please
register
or
login
to post a comment