enter-mix.ts 923 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { params, token } from "../env";
  2. import { post, login } from "./enter-shared";
  3. import './enter-case'
  4. import { ElMessage } from "element-plus";
  5. let isLoging = false;
  6. window.platform.login = (isBack = true) => {
  7. if (isLoging) {
  8. throw "登录中";
  9. }
  10. isLoging = true;
  11. if (import.meta.env.DEV) {
  12. post("/fusion/fdLogin", {
  13. code: "0d76b739ded59dd5",
  14. deptId: 1,
  15. password: "IQVPKappIyMjIyMjIyMmE=2dfWAaLBMjJcP1bu3l",
  16. phoneNum: "88888888888",
  17. }).then((res) => {
  18. params.value.token = res.token;
  19. console.error(res.token);
  20. // console.log(res.token, {...params.value})
  21. setTimeout(() => location.reload(), 1000);
  22. isLoging = false;
  23. });
  24. return;
  25. }
  26. return login(isBack)
  27. };
  28. setTimeout(() => {
  29. if (!params.value.caseId || !token) {
  30. ElMessage.error("当前项目号不存在!");
  31. } else {
  32. window.platform.getSceneList("");
  33. }
  34. }, 500);