How to use the iview.Message.warning function in iview

To help you get started, we’ve selected a few iview 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 liumapp / file-workflow / flow-ui / src / libs / util.js View on Github external
util.checkStatus = function checkStatus (response) {
  // loading
  // 如果http状态码正常,则直接返回数据
  // console.log(response)
  if (response && (response.status === 200 || response.status === 304 || response.status === 400)) {
    return response;
    // 如果不需要除了data之外的数据,可以直接 return response.data
  }
  Message.warning('网络异常');
  // 异常状态下,把错误信息返回去
  return {
    status: -404,
    msg: '网络异常'
  };
};
github liumapp / synchronizing-doc-convert-results / synch-ui / src / libs / util.js View on Github external
util.checkStatus = function checkStatus (response) {
  // loading
  // 如果http状态码正常,则直接返回数据
  // console.log(response)
  if (response && (response.status === 200 || response.status === 304 || response.status === 400)) {
    return response;
    // 如果不需要除了data之外的数据,可以直接 return response.data
  }
  Message.warning('网络异常');
  // 异常状态下,把错误信息返回去
  return {
    status: -404,
    msg: '网络异常'
  };
};
github treasureDouDou / vue-blog / src / util / axios.js View on Github external
}, err => {
    if (err && err.code == 0) {
        Message.warning('您没有权限');
    } else {
        //正则判断超时
        let rg = /8000/g
        iView.LoadingBar.error();
        if (rg.test(err)) {
            Message.error('您的网络不给力喔,请刷新重试');
        } else {
            Message.error('服务器错误');
        }
    }

    store.state.loadErr = true
    return Promise.reject(err);
})
github i-Map / iMap / src / renderer / server / ajax.js View on Github external
axios.post(obj.url, obj.data).then(data => {
        if(data.data.code === 0) {
          Message.success(data.data.msg)
          resolve(data.data)
        } else if (data.data.code === 1) {
          Message.warning(data.data.msg)
          resolve(data.data)
        } else if (data.data.code === 2) {
          Message.error(data.data.msg)
          resolve(data.data)
        } else {
          Message.error(data.data.msg)
          resolve(data.data)
        }
      }).catch(data => {
        reject(data)
github treasureDouDou / vue-blog / src / util / axios.js View on Github external
http.interceptors.response.use(res => {
    iView.LoadingBar.finish();
    if (res.data.code == 300) { //token过期
        Message.warning('您的会话已过期,请重新登录');
        localStorage.removeItem('token')
        app.$router.replace('/login')
        return Promise.reject();
    } else if (res.data.code != 200) {
        Message.error(res.data.msg);
        return Promise.reject();
    } else {
        if (res.data.token) {
            localStorage.setItem('token', res.data.token)
            accessToken = res.data.token
        }
        return res.data.data
    }
}, err => {
    if (err && err.code == 0) {
github WeBankFinTech / Scriptis / src / js / module / workbench / script / execute.js View on Github external
this.on('dataError', ({ data, execute }) => {
        execute.run = false;
        if (data.data.status === -1) {
            router.push('/login');
            Message.warning(data.message);
        } else {
            this.trigger('notice', {
                type: 'warning',
                msg: data.message,
                autoJoin: false,
            });
        }
    });
}