debuggerHelper.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // import Vue from 'vue'
  2. import { useToast } from "vue-toastification";
  3. export const debuggerHelper = (show = true) => {
  4. const version = "1.5.0--" + process.env.VUE_APP_DEBBUG_FLAG;
  5. if (show) {
  6. // log.setColors({
  7. var css = "background: #28b561; color:#fff;font-size:14px;padding:5px;";
  8. console.log(
  9. `%c 👉:当前版本::---> ${version}`,
  10. css
  11. );
  12. }
  13. if (Number(process.env.VUE_APP_DEBBUG_NOTIFY) === 1) {
  14. setTimeout(() => {
  15. const toast = useToast();
  16. toast.warning(
  17. `当前开发正在调试${version}中, 请等候!`,
  18. {
  19. position: "top-center",
  20. timeout: 400000,
  21. closeOnClick: true,
  22. pauseOnFocusLoss: true,
  23. pauseOnHover: true,
  24. draggable: true,
  25. draggablePercent: 0.6,
  26. showCloseButtonOnHover: false,
  27. hideProgressBar: true,
  28. closeButton: "button",
  29. icon: true,
  30. rtl: false,
  31. }
  32. );
  33. }, 500);
  34. }
  35. };