import { get, post, } from "@/http/http.js" import { useLoginSuccess } from '@/share/useLoginSuccess.js' const { loginSuccess } = useLoginSuccess() export function useWechatAuth() { /** * 微信登录2 */ function wechatAuth() { uni.showLoading({ title: "登录中", mask: true, }); post("/auth/wechatAuth", { redirectUrl: location.origin + location.pathname }).then(res => { uni.hideLoading(); if (res.url) { window.location.href = res.url; } else { loginSuccess(res.user); } }); } return { wechatAuth }; }