This commit is contained in:
Your Name
2026-03-01 14:17:59 +08:00
parent 65aa12f146
commit a07e844c47
6071 changed files with 777651 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { getClient } from '~~/utils/env'
// 登录
export function login(params: any) {
return $request.post({
url: '/login/account',
params: { ...params, terminal: getClient() }
})
}
// 登录
export function logout() {
return $request.post({ url: '/login/logout' })
}
//注册
export function register(params: any) {
return $request.post({
url: '/login/register',
params: { ...params, channel: 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
View File
@@ -0,0 +1,19 @@
//发送短信
export function smsSend(params: any) {
return $request.post({ url: '/sms/sendCode', params })
}
// 获取配置
export function getConfig() {
return $request.get({ url: '/pc/config' })
}
// 获取协议
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
View File
@@ -0,0 +1,57 @@
/**
* @description 获取文章分类
* @return { Promise }
*/
export function getArticleCate() {
return $request.get({ url: '/article/cate' })
}
/**
* @description 获取文章列表
* @return { Promise }
*/
export function getArticleList(params) {
return $request.get({ url: '/article/lists', 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
View File
@@ -0,0 +1,4 @@
//首页数据
export function getIndex() {
return $request.get({ url: '/pc/index' })
}
+36
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 })
}