How to use the iview.Message.error 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 1024-lab / smart-admin / smart-admin-web / src / lib / http.js View on Github external
error => {
    Spin.hide();
    Message.error('服务内部错误');
    console.log('1111', error);
    // 对响应错误做点什么
    return Promise.reject(error);
  }
);
github LianjiaTech / fee / client / src / libs / axios.js View on Github external
(error) => {
        Message.error('服务内部错误')
        // 对响应错误做点什么
        return Promise.reject(error)
      }
    )
github codedart2018 / vue-backstage-manage / src / libs / http.js View on Github external
}).catch((error) => {
        if (error.status === 200) {
          if (!error.data) {
            Message.error('接口输出异常...');
            console.log('Customize Notice', error);
          } else if (error.data && error.data.code === 2000) {
            Message.error(error.data.msg);
            console.log('Customize Notice', error);
          }
        } else if (error.status === 500) {
          Message.error('后端服务请求500错误,如一直出现错误,请联系我们');
          console.log('Customize Notice', error);
        } else {
          Message.error('服务请求出错');
          console.log('Customize Notice', error);
        }
        closeLoading();
        reject(error);
      });
    });
github codedart2018 / vue-backstage-manage / src / libs / http.js View on Github external
}).catch((error) => {
        if (error.status === 200) {
          if (!error.data) {
            Message.error('接口输出异常...');
            console.log('Customize Notice', error);
          } else if (error.data && error.data.code === 2000) {
            this.$Message.error(error.data.msg);
            console.log('Customize Notice', error);
          }
        } else if (error.status === 500) {
          Message.error('后端服务请求500错误,如一直出现错误,请联系我们');
          console.log('Customize Notice', error);
        } else {
          Message.error('服务请求出错');
          console.log('Customize Notice', error);
        }
        closeLoading();
        reject(error);
      });
    });
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
jsonp(obj.url + '?' + qs.stringify(obj.data) , null,  (err, data) => {
        if (err) {
          Message.error('请求错误')
        } else if(data.status === 0) {
          resolve(data)
        } else if(data.code === 0) {
          resolve(data)
        } else {
          if(getUrlRelativePath() === '/')
            resolve(data)
          else
            Message.error('请求错误')
        }
      })
    })
github WeBankFinTech / Scriptis / src / js / service / api.js View on Github external
.catch(function(error) {
            error.message && Message.error(error.message);
            throw error;
        });
};
github lscho / ThinkJS-Vue.js-blog / client / src / axios / index.js View on Github external
} else {
		let errmsg = "";
		const errno = data.data.errno;
		switch (errno) {
			case 1001:
				//数据检验未通过
				for (let i in data.data.data) {
					errmsg += data.data.data[i] + ";";
				}
				break;
			default:
				errmsg = data.data.errmsg;
				break;
		}
		if (errmsg != "" && errno != 0) {
			Message.error(errmsg);
		}
		if (errmsg != "" && errno == 0) {
			Message.success(errmsg);
		}
	}
    LoadingBar.finish();
	return data;
}, error => {
	let errmsg = "服务器响应错误";
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 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)