1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import { useMyRequest } from '~/composables/useFetchRequest'
- enum Api {
- Login = '/client-s003/s003Customer/login',
- UserInfo = '/client/user/userinfo',
- Logout = '/client/user/logout',
- Register = '/client/user/preRegister',
- ValidateRegister = '/client/user/register',
- ValidateEmail = '/client/user/forgetPassword',
- ResetOrChangePassword = '/client/user/changePassword',
- ValidateEmailIsExist = '/client-s003/s003Customer/lastLoginType',
- SendEmailCode = '/client-s003/captcha/sms/send',
- }
- /**
- * 验证邮箱是否存在
- */
- export async function validateEmailIsExistApi(params: any) {
- return await useMyRequest().get(Api.ValidateEmailIsExist, params)
- }
- /**
- * 验证邮箱是否存在
- */
- export async function getEmailCodeApi(params: any) {
- return await useMyRequest().post(Api.SendEmailCode, params)
- }
- /**
- * @description: user login api
- */
- export async function loginApi(params: any) {
- return await useMyRequest().post(Api.Login, params)
- }
- /**
- * 预注册
- * @param params
- * @param mode
- * @returns
- */
- export async function registerApi(params: any) {
- return await useMyRequest().post(Api.Register, params)
- }
- /**
- * 注册
- * @param params
- * @returns
- */
- export async function validateRegisterApi(params: any) {
- return await useMyRequest().post(Api.ValidateRegister, params)
- }
- /**
- * 忘记密码,发送邮箱
- * @param params
- * @returns
- */
- export async function validateEmailApi(params: any) {
- return await useMyRequest().post(Api.ValidateEmail, params)
- }
- /**
- * 更新用户信息
- * @param params
- * @returns
- */
- export async function updateUserInfoApi(params: any) {
- return await useMyRequest().post(Api.UserInfo, params)
- }
- /**
- * 重置密码
- * @param params
- * @returns
- */
- export async function resetOrChangePasswordApi(params: any) {
- return await useMyRequest().post(Api.ResetOrChangePassword, params)
- }
- /**
- * @description: getUserInfo
- */
- export async function getUserProfileApi() {
- return await useMyRequest().get(Api.UserInfo)
- }
- export async function logoutApi() {
- return await useMyRequest().get(Api.Logout)
- }
|