h5/utils/service.js
@@ -18,7 +18,7 @@ method: options.method || 'GET', header: options.header || { // 根据实际接口设计 key 取 token 或者 authorization dm_user_token: token, dm_user_token: token || '', "content-type": 'application/json' }, success: (res) => { @@ -34,7 +34,7 @@ duration: 2000 }) }) if (data.code === 500) { if (data.code === 500 || data.code === 5112) { uni.clearStorageSync() return uni.navigateTo({ url: '/pages/login/login' @@ -48,7 +48,8 @@ fail: (err) => { // 页面中弹框显示失败 uni.showToast({ title: '请求接口失败' title: '请求接口失败', icon:"none" }) // 返回错误消息