web-component-gallery 0.1.25 → 0.1.26
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/package.json +1 -1
- package/plugins/method/AMap.js +3 -0
- package/plugins/utils/PostMessage.js +12 -10
package/package.json
CHANGED
package/plugins/method/AMap.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import notification from 'ant-design-vue/es/notification'
|
|
2
2
|
|
|
3
|
+
/* 抛出401错误码 用于处理不同项目下处理方式 */
|
|
4
|
+
export function errorMessage(status, { msg }, callBack = () => {}) {
|
|
5
|
+
/* 200为正常状态码 捕捉到直接返回 */
|
|
6
|
+
if(status === 200) return
|
|
7
|
+
if(status === 401) return callBack()
|
|
8
|
+
notification.error({
|
|
9
|
+
message: '请求失败!',
|
|
10
|
+
description: msg || '服务器请求失败'
|
|
11
|
+
})
|
|
12
|
+
}
|
|
13
|
+
|
|
3
14
|
export default {
|
|
4
|
-
|
|
5
|
-
errorMessage(status, { msg }, callBack = () => {}) {
|
|
6
|
-
/* 200为正常状态码 捕捉到直接返回 */
|
|
7
|
-
if(status === 200) return
|
|
8
|
-
if(status === 401) return callBack()
|
|
9
|
-
notification.error({
|
|
10
|
-
message: '请求失败!',
|
|
11
|
-
description: msg || '服务器请求失败'
|
|
12
|
-
})
|
|
13
|
-
}
|
|
15
|
+
errorMessage
|
|
14
16
|
}
|