This commit is contained in:
quantulr
2023-10-29 18:37:44 +08:00
commit 373b3d9dff
1813 changed files with 131892 additions and 0 deletions

41
pc/api/account.ts Normal file
View File

@ -0,0 +1,41 @@
// 登录
export function mobileLogin(params: any) {
return $request.post({
url: '/login/mobileLogin',
params
})
}
export function accountLogin(params: any) {
return $request.post({
url: '/login/accountLogin',
params
})
}
//注册
export function register(params: any) {
return $request.post({
url: '/login/register',
params
})
}
//向微信请求code的链接
export function getWxCodeUrl() {
return $request.get({
url: '/login/scanCodeUrl',
params: {
url: location.href
}
})
}
export function wxLogin(params: any) {
return $request.post({ url: '/login/scanLogin', params })
}
//忘记密码
export function forgotPassword(params: Record<string, any>) {
return $request.post({ url: '/login/forgotPassword', params })
}

19
pc/api/app.ts Normal file
View File

@ -0,0 +1,19 @@
//发送短信
export function smsSend(params: any) {
return $request.post({ url: '/index/sendSms', params })
}
// 获取配置
export function getConfig() {
return $request.get({ url: '/pc/getConfig' })
}
// 获取协议
export function getPolicy(params: any) {
return $request.get({ url: '/index/policy', params })
}
// 上传图片
export function uploadImage(params: any) {
return $request.uploadFile({ url: '/upload/image' }, params)
}

57
pc/api/news.ts Normal file
View File

@ -0,0 +1,57 @@
/**
* @description 获取文章分类
* @return { Promise }
*/
export function getArticleCate() {
return $request.get({ url: '/article/category' })
}
/**
* @description 获取文章列表
* @return { Promise }
*/
export function getArticleList(params) {
return $request.get({ url: '/article/list', params })
}
/**
* @description 获取资讯中心
* @return { Promise }
*/
export function getArticleCenter() {
return $request.get({ url: '/pc/articleCenter' })
}
/**
* @description 文章详情
* @return { Promise }
*/
export function getArticleDetail(params) {
return $request.get({ url: '/pc/articleDetail', params })
}
/**
* @description 加入收藏
* @param { number } id
* @return { Promise }
*/
export function addCollect(params) {
return $request.post({ url: '/article/collectAdd', params })
}
/**
* @description 取消收藏
* @param { number } id
* @return { Promise }
*/
export function cancelCollect(params) {
return $request.post({ url: '/article/collectCancel', params })
}
/**
* @description 获取收藏列表
* @return { Promise }
*/
export function getCollect(params) {
return $request.get({ url: '/article/collectList', params })
}

4
pc/api/shop.ts Normal file
View File

@ -0,0 +1,4 @@
//首页数据
export function getIndex() {
return $request.get({ url: '/pc/index' })
}

26
pc/api/user.ts Normal file
View File

@ -0,0 +1,26 @@
export function getUserCenter(headers?: any) {
return $request.get({ url: '/user/center', headers })
}
// 个人信息
export function getUserInfo() {
return $request.get({ url: '/user/info' })
}
// 个人编辑
export function userEdit(params: any) {
return $request.post({ url: '/user/edit', params })
}
// 绑定手机
export function userBindMobile(params: any, headers?: any) {
return $request.post(
{ url: '/user/bindMobile', params, headers },
{ withToken: !headers?.token }
)
}
// 更改密码
export function userChangePwd(params: any) {
return $request.post({ url: '/user/changePwd', params })
}