王震
2023-08-28 694ffa950bf2435affef95272c7bfd6b62704639
src/utils/request.js
@@ -48,6 +48,31 @@
    // if the custom code is not 20000, it is judged as an error.
    if (res.code !== 200) {
      if(res.code===400){
        Message({
        message: res.message,
        type: 'warning',
        duration: 5 * 1000
      })
      }
      if(res.code===401){
        Message({
        message: res.message,
        type: 'warning',
        duration: 5 * 1000
      })
      sessionStorage.removeItem("user")
      sessionStorage.setItem("flushPage",1)
      this.$router.replace({path: '/login'});
      location.reload()
      }
      if(res.code===403){
        Message({
        message: res.message,
        type: 'warning',
        duration: 5 * 1000
      })
      }
      // Message({
      //   message: res.message || 'Error',
      //   type: 'error',