更新:游客模式、我的湖分、我的证书

This commit is contained in:
2025-12-09 14:28:02 +08:00
parent 79aa8e3fe6
commit 66b004d6bf
18 changed files with 702 additions and 60 deletions

View File

@@ -2,6 +2,9 @@
import { mainClient } from '@/api/clients/main'
import type { IApiResponse } from '@/api/types'
import type { IAgreement } from '@/types/user'
import { useUserStore } from '@/stores/user'
export const commonApi = {
/**
@@ -36,8 +39,9 @@ export const commonApi = {
* @returns 消息列表
*/
getMessageList(isBook: number, isMedical: number, isSociology: number) {
const userStore = useUserStore()
return mainClient.request<IMessageListResponse>({
url: 'common/message/listByPage',
url: userStore.token ? 'common/message/listByPage' : '/visitor/listByPage',
method: 'POST',
data: { isBook, isMedical, isSociology }
})

View File

@@ -14,6 +14,9 @@ import type {
} from '@/types/course'
import type { ISearchRequest, ISearchResponse } from '@/types/search'
import type { ICommentListResponse, IAddCommentResponse, IComment } from '@/types/comment'
import { useUserStore } from '@/stores/user'
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
@@ -57,8 +60,9 @@ export const courseApi = {
page: number,
limit: number
}) {
const userStore = useUserStore()
return client.request<IMarketCourseListResponse>({
url: 'medical/home/getMarketCourseList',
url: userStore.token ? 'medical/home/getMarketCourseList' : 'visitor/getMarketCourseList',
method: 'POST',
data
})

View File

@@ -7,6 +7,8 @@ import type {
IMarketCourseListResponse,
ICourseMedicalLabelsResponse
} from '@/types/course'
import { useUserStore } from '@/stores/user'
const client = createRequestClient({ baseURL: SERVICE_MAP.MAIN })
@@ -20,8 +22,9 @@ export const courseSubjectClassificationApi = {
* @returns 分类数据
*/
getCourseMedicalTree() {
const userStore = useUserStore()
return client.request<ICourseCategoryResponse>({
url: 'medical/home/getCourseMedicalTree',
url: userStore.token ? 'medical/home/getCourseMedicalTree' : '/visitor/getCourseMedicalTree',
method: 'POST',
data: {}
})

View File

@@ -313,4 +313,32 @@ export async function migrateUserData(data: { tel: string, code: string }) {
data
})
return res
}
/**
* 我的湖分
* @return
*/
export async function getUserContributionData() {
const res = await mainClient.request<IApiResponse>({
url: 'common/userContribution/getUserContribution',
method: 'POST'
})
return res
}
/**
* 湖分列表
* @param current 当前页码
* @param limit 每页数量
* @param type 湖分类型
* @return
*/
export async function getUserContributionByTypeList(current : number, limit : number, type : string,) {
const res = await mainClient.request<IApiResponse>({
url: 'common/userContribution/getUserContributionByType',
method: 'POST',
data: { current, limit, type, }
})
return res
}