Login-dev.6b0c82e3.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import { v as defineComponent, r as ref, B as createElementBlock, E as createBaseVNode, C as createVNode, D as withCtx, aA as useRouter, ak as resolveComponent, y as openBlock, M as createTextVNode } from "./vue-dev.7a51ac2d.js";
  2. import { u as useAuthStore } from "./index-dev.bb5c7162.js";
  3. import { _ as _export_sfc } from "./_plugin-vue_export-helper-dev.cc2b3d55.js";
  4. import "./element-dev.26a170ea.js";
  5. import "./utils-dev.be08a1a2.js";
  6. const _hoisted_1 = { class: "login-container" };
  7. const _hoisted_2 = { class: "login-box" };
  8. const _hoisted_3 = { class: "login-content" };
  9. const _sfc_main = /* @__PURE__ */ defineComponent({
  10. __name: "Login",
  11. setup(__props) {
  12. const router = useRouter();
  13. const authStore = useAuthStore();
  14. const loading = ref(false);
  15. const handleSSOLogin = () => {
  16. loading.value = true;
  17. window.location.href = "/auth/login";
  18. };
  19. if (authStore.isAuthenticated) {
  20. router.push("/dashboard");
  21. }
  22. return (_ctx, _cache) => {
  23. const _component_Key = resolveComponent("Key");
  24. const _component_el_icon = resolveComponent("el-icon");
  25. const _component_el_button = resolveComponent("el-button");
  26. return openBlock(), createElementBlock("div", _hoisted_1, [
  27. createBaseVNode("div", _hoisted_2, [
  28. _cache[2] || (_cache[2] = createBaseVNode("div", { class: "login-header" }, [
  29. createBaseVNode("h1", null, "子系统示例"),
  30. createBaseVNode("p", null, "请通过SSO认证中心登录")
  31. ], -1)),
  32. createBaseVNode("div", _hoisted_3, [
  33. createVNode(_component_el_button, {
  34. type: "primary",
  35. size: "large",
  36. loading: loading.value,
  37. onClick: handleSSOLogin,
  38. class: "sso-login-btn"
  39. }, {
  40. default: withCtx(() => [
  41. createVNode(_component_el_icon, null, {
  42. default: withCtx(() => [
  43. createVNode(_component_Key)
  44. ]),
  45. _: 1
  46. }),
  47. _cache[0] || (_cache[0] = createTextVNode(" 通过SSO登录 ", -1))
  48. ]),
  49. _: 1
  50. }, 8, ["loading"]),
  51. _cache[1] || (_cache[1] = createBaseVNode("div", { class: "login-info" }, [
  52. createBaseVNode("p", null, "点击上方按钮将跳转到SSO认证中心进行登录"),
  53. createBaseVNode("p", null, "登录成功后将自动返回本系统")
  54. ], -1))
  55. ])
  56. ])
  57. ]);
  58. };
  59. }
  60. });
  61. const Login_vue_vue_type_style_index_0_scoped_6812616a_lang = "";
  62. const Login = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-6812616a"]]);
  63. export {
  64. Login as default
  65. };
  66. //# sourceMappingURL=Login-dev.6b0c82e3.js.map