更新:登录功能
This commit is contained in:
31
api/modules/common.ts
Normal file
31
api/modules/common.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
// api/modules/common.ts
|
||||
import { mainClient } from '@/api/clients/main'
|
||||
import type { IApiResponse } from '@/api/types'
|
||||
import type { IAgreement } from '@/types/user'
|
||||
|
||||
export const commonApi = {
|
||||
/**
|
||||
* 发送邮箱验证码
|
||||
* @param email 邮箱地址
|
||||
*/
|
||||
sendMailCaptcha: async (email: string) => {
|
||||
const res = await mainClient.request<IApiResponse>({
|
||||
url: 'common/user/getMailCaptcha',
|
||||
method: 'GET',
|
||||
data: { email }
|
||||
})
|
||||
return res.data
|
||||
},
|
||||
/**
|
||||
* 获取协议内容
|
||||
* @param id 协议 ID (111: 用户协议, 112: 隐私政策)
|
||||
*/
|
||||
getAgreement: async (id: number) => {
|
||||
const res = await mainClient.request<IApiResponse<IAgreement>>({
|
||||
url: 'sys/agreement/getAgreement',
|
||||
method: 'POST',
|
||||
data: { id }
|
||||
})
|
||||
return res.agreement
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user