@kengic/uni 0.6.3-beta.5 → 0.6.3-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/service/http-client.ts +19 -1
- package/package.json +1 -1
|
@@ -69,9 +69,20 @@ type IRequestOptions = Omit<UniApp.RequestOptions, 'url'> & {
|
|
|
69
69
|
*/
|
|
70
70
|
dynamicQueryOperatorModel?: Record<string, KG_DYNAMIC_QUERY_OPERATOR>;
|
|
71
71
|
|
|
72
|
-
/**
|
|
72
|
+
/**
|
|
73
|
+
* 是否不显示错误消息提示.
|
|
74
|
+
*
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
73
77
|
isSuppressError?: boolean;
|
|
74
78
|
|
|
79
|
+
/**
|
|
80
|
+
* 是否不显示成功消息提示.
|
|
81
|
+
*
|
|
82
|
+
* @default false
|
|
83
|
+
*/
|
|
84
|
+
isSuppressSuccess?: boolean;
|
|
85
|
+
|
|
75
86
|
/** 是否处理请求结果. */
|
|
76
87
|
isTransformResponse?: boolean;
|
|
77
88
|
|
|
@@ -101,6 +112,13 @@ function handleSuccess<T = any>(
|
|
|
101
112
|
reject: (reason?: any) => void,
|
|
102
113
|
options?: IRequestOptions,
|
|
103
114
|
) {
|
|
115
|
+
// 显示后端成功消息
|
|
116
|
+
if (!options?.isSuppressSuccess) {
|
|
117
|
+
if ((response.data as any).message) {
|
|
118
|
+
uni.showToast({ icon: 'none', title: (response.data as any).message });
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
104
122
|
if (options?.isTransformResponse === false) {
|
|
105
123
|
resolve(response.data as any);
|
|
106
124
|
} else {
|
package/package.json
CHANGED