跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[Vue.js] 处理非后端接口的错误问题

发表于
vue 代码
http://1.117.77.5/vue_1.png

接口请求
http://1.117.77.5/api_request.jpg

问题:
像这个 vue 中 function(error)里面能否判断响应 header 呢?

背景及原因:
如果这种方式不行,有没有别的方式去修改呢,最终的意思是要根据响应的状态码及 header ,去判断当前前端应该弹出什么样的错误,避免都是后端异常,有些并不是后端的问题,有可能是前置机或者某些安全拦截的问题,如果是别的云安全软件拦截了,根据对应的 response header 去给出对应的内容的错误响应

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.