initial commit
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
|
||||
/**
|
||||
* 用户登录认证
|
||||
*/
|
||||
export function authenticateUser(data: AnyObject) {
|
||||
return request.post('/auth/login', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机验证码登录
|
||||
*/
|
||||
export function authenticateWithMobile(data: AnyObject) {
|
||||
return request.post('/auth/login/mobile', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取登录配置信息
|
||||
*/
|
||||
export function getLoginConfig() {
|
||||
return request.get('/auth/config')
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户退出登录
|
||||
*/
|
||||
export function logoutUser() {
|
||||
return request.post('/auth/logout')
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户注册
|
||||
*/
|
||||
export function registerUser(data: AnyObject) {
|
||||
const url = data.pid ? `/auth/register?pid=${data.pid}` : '/auth/register'
|
||||
return request.post(url, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 手机号注册
|
||||
*/
|
||||
export function registerWithMobile(data: AnyObject) {
|
||||
const url = data.pid ? `/auth/register/mobile?pid=${data.pid}` : '/auth/register/mobile'
|
||||
return request.post(url, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信授权登录
|
||||
*/
|
||||
export function authenticateWithWechat(data: AnyObject) {
|
||||
return request.post('/auth/wechat', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序登录
|
||||
*/
|
||||
export function authenticateWithWeapp(data: AnyObject) {
|
||||
return request.post('/auth/weapp', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定手机号
|
||||
*/
|
||||
export function bindMobile(data: AnyObject) {
|
||||
const url = data.pid ? `/auth/bind?pid=${data.pid}` : '/auth/bind'
|
||||
return request.post(url, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成微信扫码登录二维码
|
||||
*/
|
||||
export function generateWechatQrCode() {
|
||||
return request.post('/auth/wechat/scan')
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查微信扫码状态
|
||||
*/
|
||||
export function checkWechatScanStatus(data: AnyObject) {
|
||||
return request.get('/auth/wechat/scan/status', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查微信登录可用性
|
||||
*/
|
||||
export function checkWechatAvailability() {
|
||||
return request.get('/auth/wechat/availability')
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* 获取会员基本信息
|
||||
*/
|
||||
export function getMemberProfile() {
|
||||
return request.get('/member/profile')
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新会员信息
|
||||
*/
|
||||
export function updateMemberInfo(data: AnyObject) {
|
||||
return request.put(`/member/profile/${data.field}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取积分流水记录
|
||||
*/
|
||||
export function getPointTransactions(data: AnyObject) {
|
||||
return request.get('/member/points/transactions', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员积分总额
|
||||
*/
|
||||
export function getMemberPointsTotal() {
|
||||
return request.get('/member/points/total')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取余额流水记录
|
||||
*/
|
||||
export function getBalanceTransactions(data: AnyObject) {
|
||||
return request.get('/member/balance/transactions', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有余额流水记录
|
||||
*/
|
||||
export function getAllBalanceTransactions(data: AnyObject) {
|
||||
return request.get('/member/balance/transactions/all', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定会员手机号
|
||||
*/
|
||||
export function bindMemberMobile(data: AnyObject) {
|
||||
return request.put('/member/mobile', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取会员等级信息
|
||||
*/
|
||||
export function getMemberLevel() {
|
||||
return request.get('/member/level')
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* 获取验证码图片
|
||||
*/
|
||||
export function getCaptchaImage() {
|
||||
return request.get('/system/captcha', { time: Date.now() })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信授权码
|
||||
*/
|
||||
export function getWechatAuthCode(data: AnyObject) {
|
||||
return request.get('/system/wechat/auth-code', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步微信用户信息
|
||||
*/
|
||||
export function syncWechatUserInfo(data: AnyObject) {
|
||||
return request.get('/system/wechat/sync', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取协议内容
|
||||
*/
|
||||
export function getAgreementContent(key: string) {
|
||||
return request.get(`/system/agreement/${key}`)
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置用户密码
|
||||
*/
|
||||
export function resetUserPassword(data: AnyObject) {
|
||||
return request.post('/system/password/reset', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
*/
|
||||
export function sendSmsVerificationCode(data: AnyObject) {
|
||||
return request.post(`/system/sms/${data.type}`, data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取微信 JSSDK 配置
|
||||
*/
|
||||
export function getWechatJssdkConfig(data: AnyObject) {
|
||||
return request.get('/system/wechat/jssdk-config', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取远程图片
|
||||
*/
|
||||
export function fetchRemoteImage(data: AnyObject) {
|
||||
return request.post('/system/image/fetch', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 Base64 格式图片
|
||||
*/
|
||||
export function fetchBase64Image(data: AnyObject) {
|
||||
return request.post('/system/image/base64', data)
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取版权信息
|
||||
*/
|
||||
export function getCopyrightInfo() {
|
||||
return request.get('/system/copyright')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取站点信息
|
||||
*/
|
||||
export function getSiteInformation() {
|
||||
return request.get('/system/site')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取广告位信息
|
||||
*/
|
||||
export function getAdvertisementInfo(params: Record<string, any>) {
|
||||
return request.get('/system/web/advertisements', params, { showErrorMessage: false })
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取导航菜单列表
|
||||
*/
|
||||
export function getNavigationList() {
|
||||
return request.get('/system/web/navigation')
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取友情链接列表
|
||||
*/
|
||||
export function getFriendlyLinks() {
|
||||
return request.get('/system/web/friendly-links')
|
||||
}
|
||||
Reference in New Issue
Block a user