import Vue from 'vue'

let vue = new Vue()

function changeState(item, type, cb=()=>{}) {
  vue.$http
    .get(`/manage/${type}/display/${item.id}/${item.display * 1}`, {
      headers: {
        token: window.localStorage.getItem("token"),
      },
    })
    .then((res) => {
      if (res.code === 0) {
        cb(res)
        // this.refresh();
      } else {
        vue.$notify.error({
          title: "错误",
          message: res.msg
        });
      }
    });
}

export {changeState};
