How to use the ant-design-vue/es/message.error function in ant-design-vue

To help you get started, we’ve selected a few ant-design-vue examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
break
        case 400:
          Message.warn(res.data.message || res.data.msg || '资源不在收藏列表中')
          break
        case 401:
          store.commit('User/SET_SHOW_LOGIN', true)
          store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
    } else {
      console.log('error', error.message)
      Toast({
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
break
        case 401:
          store.commit('User/SET_SHOW_LOGIN', true)
          store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
    } else {
      console.log('error', error.message)
      Toast({
        icon: 'close',
        content: '请检查网络连接状态!'
      })
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
    } else {
      console.log('error', error.message)
      Toast({
        icon: 'close',
        content: '请检查网络连接状态!'
      })
    }
    return Promise.reject(error.response)
  })
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
case 301:
          store.commit('User/SET_SHOW_LOGIN', true)
          store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.warn(res.data.msg || '请先登录')
          break
        case 400:
          Message.warn(res.data.message || res.data.msg || '资源不在收藏列表中')
          break
        case 401:
          store.commit('User/SET_SHOW_LOGIN', true)
          store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
github xiaozhu188 / electron-vue-cloud-music / src / renderer / store / modules / Download.js View on Github external
let downloadUrl = await getUrl(id)
      if (downloadUrl) {
        ipcRenderer.send('download-start', {
          url: downloadUrl,
          filename,
          id,
          song,
          downloadFolder: rootState.Setting.downloadSongsFolders[0]
        })
      } else {
        Message.error(`歌曲${name}无下载资源!`)
        commit('REMOVE_QUEUE', song)
        dispatch('download')
      }
    } catch (err) {
      Message.error('下载失败' + err)
      commit('REMOVE_QUEUE', song)
      dispatch('download')
    }
  },
  adddownloadQueue ({commit, dispatch, state}, songs) {
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.warn(res.data.msg || '请先登录')
          break
        case 400:
          Message.warn(res.data.message || res.data.msg || '资源不在收藏列表中')
          break
        case 401:
          store.commit('User/SET_SHOW_LOGIN', true)
          store.commit('User/SET_USER_INFO', {})
          store.commit('App/SET_REDIRECT', '/home')
          localStorage.removeItem('userId')
          Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
    } else {
      console.log('error', error.message)
      Toast({
        icon: 'close',
        content: '请检查网络连接状态!'
      })
    }
    return Promise.reject(error.response)
  })
github xiaozhu188 / electron-vue-cloud-music / src / renderer / store / modules / Download.js View on Github external
let queue = state.queue
    let song = queue[0]
    let {id, name} = song
    let filename = generateName(song)
    try {
      let downloadUrl = await getUrl(id)
      if (downloadUrl) {
        ipcRenderer.send('download-start', {
          url: downloadUrl,
          filename,
          id,
          song,
          downloadFolder: rootState.Setting.downloadSongsFolders[0]
        })
      } else {
        Message.error(`歌曲${name}无下载资源!`)
        commit('REMOVE_QUEUE', song)
        dispatch('download')
      }
    } catch (err) {
      Message.error('下载失败' + err)
      commit('REMOVE_QUEUE', song)
      dispatch('download')
    }
  },
  adddownloadQueue ({commit, dispatch, state}, songs) {
github xiaozhu188 / electron-vue-cloud-music / src / renderer / utils / request.js View on Github external
Message.error(res.data.msg || '请先登录')
          break
        case 403:
          Message.error(res.data.msg || '权限不足')
          break
        case 404:
          Message.error(res.data.msg || '请求资源不存在')
          break
        case 408:
          Message.error(res.data.message || '已经收藏过该视频')
          break
        case 500:
          Message.error(res.data.msg || '服务器开小差啦')
          break
        case 504:
          Message.error(res.data.msg || '网络请求失败')
          break
        default:
          Message.error(res.data.msg || res.statusText)
      }
    } else {
      console.log('error', error.message)
      Toast({
        icon: 'close',
        content: '请检查网络连接状态!'
      })
    }
    return Promise.reject(error.response)
  })