<template>
  <div>

  </div>
</template>

<script>
import api from "@/components/api.vue";
import qs from "qs";
export default {
  data() {
    return {
      websockFlag: true,//开关变量
    };
  },
  methods: {
   //保存 saveItem() {
if (!websockFlag) { this.$message("正在请求中,请勿重复操作!"); this.websockFlag = true; return; } let parm = { token: JSON.parse(localStorage.userMsg).token, point_key: this.point_key, control_value: this.control_value }; this.websockFlag = false; // 解决异步,不要写在api请求中 api.selectUserInfo(qs.stringify(param)).then(res => { if (res) { this.websockFlag = true; //清零 该次请求未完成,不允许进行下次请求 } if (res.code != 200) { this.$message({ message: "请求失败!", type: "success", showClose: true }); } }); } } }; </script> <style lang="scss"> </style>

相关文章:

  • 2021-11-12
  • 2022-01-26
  • 2021-12-03
  • 2022-03-03
  • 2023-03-08
  • 2021-12-11
  • 2021-12-03
  • 2021-11-12
猜你喜欢
  • 2021-07-29
  • 2021-07-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案