export default {
  methods: {
    async logout() {
      if (this.$route.path !== "/login") {
        await this.$store.dispatch("user/logout");
        this.$router.push(`/login?redirect=${this.$route.fullPath}`);
      }
    },
    async routeGoto(path, query) {
      window.vm.$router.push({
        path: path,
        query: query,
      });
    },
    async routeReGoto(path, query) {
      window.vm.$router.replace({
        path: path,
        query: query,
      });
    },
    setNum(s) {
      return s ? parseFloat(s + "").toFixed(2) : "-";
    },
  }
}
