Files
front-pc/api/common/index.ts

83 lines
2.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { post, get } from '@/utils/axios'
import type { AppMemberUserInfoRespVO, NotifyMessageRespVO, fileCreateReqVO } from '@/api/common/types'
/**
* 获取省份地区
* @return {Promise}
*/
export const tree = (params: { id?: number | string }) => {
return get<IResponse<any[]>>({
url: '/prod-api/app-api/system/area/tree',
params,
})
}
/**
* 上传附件
* @return {Promise}
*/
export const upload = (uploadUrl = '/prod-api/app-api/infra/file/upload', params: any) => {
return post<IResponse<any>>({
url: uploadUrl,
data: params,
})
}
/**
* 上传附件
* @return {Promise}
*/
export const uploadV2 = (uploadUrl = '/prod-api/app-api/infra/file/presigned-url', params: any) => {
return get<IResponse<any>>({
url: uploadUrl,
params: params,
})
}
/**
* 创建文件
*/
export const creatFile = (params: fileCreateReqVO) => {
return post<IResponse<any>>({
url: '/prod-api/app-api/infra/file/create',
data: params,
})
}
/**
* 获取用户信息
* @return {Promise}
*/
export const getUserInfo = () => {
return get<IResponse<AppMemberUserInfoRespVO>>({
url: '/prod-api/app-api/member/user/get',
})
}
/**
* 发送验证码
* templateCode:"user-sms-login"description:"会员用户 - 手机号登陆")
* MEMBER_LOGIN( scene:1,description:"会员用户 - 修改手机")
* MEMBER_UPDATE_MOBILE( scene:2,templateCode: "user-update-mobile",MEMBER UPDATE PASSWORD
* ( scene: 3,templateCode:"user-update-password", description:"会员用户 - 修改密码"),
* MEMBER_RESET_PASSWORD( scene:4templateCode:"user-reset-password"description:"会员用户 - 忘记密码"),
ADMIN_MEMBER_LOGIN( scene: 21, templateCode: "admin-sms-login", description:"后台用户 -手机号登录")
description:"后台用户 -手机号注册")
ADMIN_MEMBER REGISTER( scene: 22,templateCode:"admin-sms-register",
ADMIN _MEMBER RESET PASSWORD( scene: 23,templateCode:"admin-reset-password", description:"后台用户 - 忘记密码");
* @return {Promise}
*/
export const sendSms = (params: { mobile: string; scene: number }) => {
return post<IResponse<any>>({
url: '/prod-api/app-api/member/auth/send-sms-code',
data: params,
})
}
/**
* 获得站内信
*/
export const getMessage = (params: { id: number }) => {
return get<IResponse<NotifyMessageRespVO>>({
url: '/prod-api/app-api/system/notify-message/get',
params,
})
}