/* 后台返回消息提示 */
import { Message } from 'element-ui';

// 后台返回异常提示
export default {
  errorMsg: function(response) {
    let local = window.location.origin;
    /* if (local.indexOf('localhost') != -1) {
      local = 'http://www.gicdev.com';
    } */
    if (response.code != '0000') {
      Message.error({
        duration: 1000,
        message: response.message
      });
      if (response.code == '2003') {
        window.location.href = local + '/gateway-web/#/login';
        return false;
      }
    }
  }
};
