import { S as SERVER_API_URL } from './server.mjs'; import { r as requestClient } from './request-BIxQh2im.mjs'; import { s as setToken } from './token-util-C_wOpB5F.mjs'; const intervalError = "[nuxt] `setInterval` should not be used on the server. Consider wrapping it with an `onNuxtReady`, `onBeforeMount` or `onMounted` lifecycle hook, or ensure you only call it in the browser by checking `false`."; const setInterval = () => { console.error(intervalError); }; async function getCaptcha() { const res = await requestClient.get( SERVER_API_URL + "/captcha" ); if (res.data.code === 0 && res.data.data) { return res.data.data; } return Promise.reject(new Error(res.data.message)); } async function loginBySms(data) { const res = await requestClient.post( SERVER_API_URL + "/loginBySms", data ); if (res.data.code === 0) { setToken(res.data.data?.access_token, data.remember); if (res.data.data?.user) { const user = res.data.data?.user; localStorage.setItem("TenantId", String(user.tenantId)); localStorage.setItem("UserId", String(user.userId)); } return res.data.message; } return Promise.reject(new Error(res.data.message)); } async function sendSmsCaptcha(data) { const res = await requestClient.post( SERVER_API_URL + "/sendSmsCaptcha", data ); if (res.data.code === 0) { return res.data.message; } return Promise.reject(new Error(res.data.message)); } export { setInterval as a, getCaptcha as g, loginBySms as l, sendSmsCaptcha as s }; //# sourceMappingURL=index-CEJdy8RB.mjs.map