import { useUserStore } from "@/stores/modules/user";
// import router from "@/routers";

//不同环境的login地址
const LOGIN_OBJ: any = {
    development: "http://localhost:8080/admin/login", //开发环境
    test: "https://dev.ow.f2b211.com/admin/login", //测试环境
    production: "https://orico.com.cn/admin/login" //生产环境
};
/**
/**https://dev.ow.f2b211.com/admin/login
 * @description 登出
 */
export const outLogin = () => {
    const userStore = useUserStore();
    //获取环境
    const NODE_ENV = import.meta.env.VITE_USER_NODE_ENV;
    //清除 本地
    localStorage.clear();
    //重置用户数据
    userStore.$reset();
    //跳转login
    setTimeout(() => {
        // router.push({ path: "/login" });
        location.href = LOGIN_OBJ[NODE_ENV];
    }, 600);
};
