wwl
2025-02-15 5b4e348267b5541d54fffcc75c7b307ad514a692
src/utils/request.js
@@ -62,6 +62,12 @@
  Promise.reject(error)
})
// 需要确认框的接口路径
const confirmDialogUrls = [
  '/hosp/order/addtTransition',
  '/hosp/customer/cusIdcard'
];
// 响应拦截器
service.interceptors.response.use(res => {
  const code = res.data.code || 200;
@@ -87,17 +93,13 @@
    }
    return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
  } else if (code === 500) {
    if (res.config.url === '/hosp/order/addtTransition') {
    if (confirmDialogUrls.includes(res.config.url)) {
      // 使用MessageBox和Message来替代this.$confirm和this.$message
      MessageBox.confirm(res.data.msg, '提示', {
      MessageBox.confirm(res.data.msg, {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning',
        center: true
      }).then(() => {
      }).catch(() => {
        type: 'error',
        showCancelButton: false,
        closeOnClickModal: false
      });
      return Promise.reject('特定接口发生500错误');
    }