How to use the ant-design-vue.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 didin1453fatih / dbdesigner.id / src / store / Account / action.js View on Github external
logoutAccount: request2(async context => {
    // context.commit("setLoadingChangePassword", true);
    context.rootCommit("GlobalLoading/setVisible", true);
    try {
      await requestHelper(Logout);
      message.success("Logout", 2);
      context.rootCommit("GlobalLoading/setVisible", false);
      setTimeout(() => {
        window.location.href = "/";
      }, 500);
    } catch (error) {
      if (error.code === 10) {
        message.error("Login first to logout", 2);
        context.rootCommit("LeftPanel/setVisible", true);
        context.rootCommit("LeftPanel/setPanelName", "login");
      } else {
        message.error(error.message, 2);
      }
      context.rootCommit("GlobalLoading/setVisible", false);
    }
  })
};
github ruyangit / admin-workbench-ui / src / utils / request.js View on Github external
//     confirmButtonText: '重新登录',
                //     cancelButtonText: '取消',
                //     type: 'warning'
                // }).then(() => {
                //     removeCookies(_CONST.TOKEN);
                //     location.reload();// 为了重新实例化vue-router对象 避免bug
                // })
            } else {
                let error;
                if (!error) {
                    error = "请求失败,异常: " + res.statusText + ' [' + res.status + ']';
                }
                message.error(error, 5);
            }
        } else {
            message.error("请求失败," + error, 5);
        }
        return Promise.reject(error)
    })
github didin1453fatih / dbdesigner.id / src / store / RightDialog / Fork / Layout / action.js View on Github external
var respond = await requestHelper(Execute, {
        origin_uuid: origin_uuid,
        forker_title: context.state.forker_title,
        forker_description: context.state.forker_description,
        forker_share_status: context.state.forker_share_status
      });
      await context.rootDispatch("Data/Project/loadProject", {
        uuid: respond.payload.uuid
      });
    } catch (error) {
      if (error.code === 10) {
        message.error("Login first to open project", 2);
        context.rootCommit("LeftDialog/FileMenu/Layout/setVisible", true);
        context.rootCommit("LeftDialog/FileMenu/Layout/setPanelName", "login");
      } else {
        message.error(error.message, 2);
      }
    }
    setTimeout(() => {
      context.commit("SET_LOADING_EXECUTE", false);
    }, 1000);
  })
};
github didin1453fatih / dbdesigner.id / src / store / Data / Project / action.js View on Github external
];
      var randomValue = parseInt(Math.random() * 16);
      context.commit(
        "setSavedMessage",
        "Saved.... " +
          emote[randomValue] +
          emote[randomValue] +
          emote[randomValue]
      );
      setTimeout(() => {
        context.commit("setSavedMessage", "");
      }, 1500);
    } catch (error) {
      if (error.code === 10) {
        context.commit("setSavedMessage", "Save failure...");
        message.error("Login first to save account", 2);
        context.rootCommit("LeftDialog/FileMenu/Layout/setVisible", true);
        context.rootCommit("LeftDialog/FileMenu/Layout/setPanelName", "login");
      } else {
        context.commit("setSavedMessage", "Save failure " + error.message);
        setTimeout(() => {
          message.error("Saved Failure " + error.message, 2);
        }, 500);
      }
    }
  }),
  autoSave: request2(async context => {
github didin1453fatih / dbdesigner.id / src / store / Share / action.js View on Github external
saveChangeStatus: request2(async context => {
    context.commit("setLoading", true);
    try {
      var shareStatusRespond = await requestHelper(SaveChangeShareStatus, {
        id: context.rootState.diagram.projectDescription.id,
        status: context.state.status,
        password: context.state.sharePassword
      });
      var payload = shareStatusRespond.payload;
      if (shareStatusRespond.success === true) {
        context.commit("setStatus", payload.share_status);
        context.commit("setSharePassword", payload.share_password);
        context.commit("setShareLink", payload.share_link);
      } else {
        message.error(shareStatusRespond.message, 2);
      }
      message.success("Updated", 2);
    } catch (error) {
      if (error.code === 10) {
        message.error("Login first to save share status", 2);
        context.rootCommit("LeftPanel/setVisible", true);
        context.rootCommit("LeftPanel/setPanelName", "login");
      } else {
        message.error(error.message, 2);
      }
    }
    context.commit("setLoading", false);
  }),
  readShareStatus: request2(async context => {
github didin1453fatih / dbdesigner.id / src / store / LeftDialog / FileMenu / Component / NewProject / action.js View on Github external
createProject: request2(async context => {
    context.commit("setLoding", true);
    try {
      var respond = await requestHelper(NewProject, {
        title: context.state.title,
        description: context.state.description
      });
      message.success("Created", 2);
      context.commit("setTitle", "");
      context.commit("setDescription", "");
      context.rootDispatch("Data/Project/loadProject", {
        id: respond.payload.id
      });
    } catch (error) {
      if (error.code === 10) {
        message.error("Login first to make new project", 2);
        context.rootCommit("LeftDialog/FileMenu/Layout/setVisible", true);
        context.rootCommit("LeftDialog/FileMenu/Layout/setPanelName", "login");
      } else {
        message.error(error.message, 2);
      }
    }
    context.commit("setLoding", false);
  })
};
github didin1453fatih / dbdesigner.id / src / store / Data / Account / action.js View on Github external
context.rootCommit("TopAlert/InformationAlert/setVisible", false);
      }
    } catch (error) {
      if (error.code === 10) {
        if (context.inputs.uuid === null) {
          message.error("Login first to start design", 3);
          context.rootCommit("LeftDialog/FileMenu/Layout/setVisible", true);
          context.rootCommit(
            "LeftDialog/FileMenu/Layout/setPanelName",
            "login"
          );
        } else {
          message.error("You are guest", 2);
        }
      } else {
        message.error(error.message, 2);
      }
      context.rootCommit("TopAlert/InformationAlert/setVisible", true);
      context.rootCommit("TopAlert/InformationAlert/setMessage", "You are guest");
    }
    context.rootCommit("GlobalLoading/setVisible", false);
  }),
};
github yanghuayi / vue-ts-admin / src / utils / request.ts View on Github external
if (domins) {
      url = url.slice(domins[0].length);
    }
    const match = pathToRegexp.parse(url);
    url = pathToRegexp.compile(url)(data);
    match.map((item: any) => {
      if (typeof item === 'object') {
        if (item instanceof Object && item.name in cloneData) {
          delete cloneData[item.name];
        }
      }
      return true;
    });
    url = domins ? domins[0] + url : url;
  } catch (e) {
    message.error(e.message);
  }

  if (fetchType === 'JSONP') {
    return new Promise((resolve, reject) => {
      jsonp(url, {
        param: `${qs.stringify(data)}&callback`,
        name: `jsonp_${new Date().getTime()}`,
        timeout: 4000,
      }, (error, result) => {
        if (error) {
          reject(error);
        }
        resolve({ statusText: 'OK', status: 200, data: result });
      });
    });
  } if (fetchType === 'YQL') {
github didin1453fatih / dbdesigner.id / src / components / TopMenu / Layout.vue View on Github external
openSharePanel() {
      if (this.accountId === null) {
        message.error("You are the guest, Login first");
        this.openLeftPanel(true);
        this.setLeftPanelName("login");
      } else if (this.title !== null) {
        this.openLeftPanel(true);
        this.setLeftPanelName("properties");
      } else {
        message.error("The project is empty");
      }
    },
    ribbonMenuClick(name) {