商品详情

This commit is contained in:
2024-03-08 18:06:33 +08:00
parent 2df1a93e6b
commit 107783062b
25 changed files with 675 additions and 63 deletions

View File

@@ -1,18 +1,19 @@
/**
* 用户信息相关接口
*/
import type { LoginByCodeParams, LoginParams, LoginResult } from './types';
import type { LoginParams, LoginResult } from './types';
import { get, post } from '@/utils/request';
import type { UserState } from '@/store/modules/user/types';
enum URL {
login = '/user/login',
loginByCode = '/user/loginByCode',
// login = '/member/login',
login = 'wechat/LoginByMa',
loginByCode = 'wechat/LoginByMaCode',
logout = '/user/logout',
profile = '/user/profile',
}
export const getUserProfile = () => get<UserState>({ url: URL.profile });
export const login = (data: LoginParams) => post<LoginResult>({ url: URL.login, data });
export const loginByCode = (data: LoginByCodeParams) => post<any>({ url: URL.loginByCode, data });
export const loginByCode = (code: string, companyId: string) => post<any>({ url: URL.loginByCode + `?code=${code}` });
export const logout = () => post<any>({ url: URL.logout });