initAuthDef.ts 698 B

1234567891011121314151617181920212223242526272829303132
  1. import { Dict_Apis } from "@/dict";
  2. import { initAuth } from "@queenjs-modules/auth";
  3. export function initAuthDef() {
  4. const auth = initAuth({
  5. config: {
  6. httpConfig: {
  7. baseURL: Dict_Apis.auth,
  8. },
  9. key: "queenshow",
  10. loginPath: "/login",
  11. loginJumpPath: "/",
  12. logoutJumpPath: "/login",
  13. needCompanyLogin: false,
  14. needRegister: true,
  15. needResetPwd: true,
  16. regInfo: {
  17. key: "queenshow",
  18. },
  19. },
  20. https: {
  21. getProfile() {
  22. return (this as any).request("/profile?appKey=" + this.config.key, {
  23. method: "GET",
  24. silence: false,
  25. });
  26. },
  27. },
  28. });
  29. auth.actions.initUser();
  30. }