This commit is contained in:
Jason
2023-01-09 19:02:20 +08:00
parent 570198d9bc
commit 5d056280b0
89 changed files with 20634 additions and 1 deletions

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

@@ -0,0 +1,35 @@
import { getClient } from '~~/utils/env'
// 登录
export function login(params: any) {
return $request.post({
url: '/login/check',
params: { ...params, client: getClient() }
})
}
// // 登录
export function logout() {
return $request.post({ url: '/login/logout' })
}
//注册
export function register(params: any) {
return $request.post({
url: '/login/register',
params: { ...params, client: getClient() }
})
}
//向微信请求code的链接
export function getWxCodeUrl() {
return $request.get({
url: '/login/getScanCode',
params: {
url: location.href
}
})
}
export function wxLogin(params: any) {
return $request.post({ url: '/login/scanLogin', params })
}

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

@@ -0,0 +1,19 @@
//发送短信
export function smsSend(params: any) {
return $request.post({ url: '/sms/send', params })
}
// 获取配置
export function getConfig() {
return $request.get({ url: '/pc/getConfig' })
}
// 获取协议
export function getPolicy(params: any) {
return $request.get({ url: '/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/infoCenter' })
}
/**
* @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/addCollect', params })
}
/**
* @description 取消收藏
* @param { number } id
* @return { Promise }
*/
export function cancelCollect(params) {
return $request.post({ url: '/article/cancelCollect', params })
}
/**
* @description 获取收藏列表
* @return { Promise }
*/
export function getCollect(params) {
return $request.get({ url: '/article/collect', params })
}

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

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

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

@@ -0,0 +1,36 @@
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/setInfo', params })
}
// 绑定手机
export function userBindMobile(params: any, headers?: any) {
return $request.post(
{ url: '/user/bindMobile', params, headers },
{ withToken: !headers?.token }
)
}
// 微信电话
export function userMnpMobile(params: any) {
return $request.post({ url: '/user/getMobileByMnp', params })
}
// 更改密码
export function userChangePwd(params: any) {
return $request.post({ url: '/user/changePassword', params })
}
//忘记密码
export function forgotPassword(params: Record<string, any>) {
return $request.post({ url: '/user/resetPassword', params })
}