更新:访客模式可以查看图书首页

This commit is contained in:
2025-12-12 14:33:47 +08:00
parent 04e2196942
commit 34d6cfdf9e
10 changed files with 43 additions and 53 deletions

View File

@@ -42,7 +42,7 @@ export const bookHomeApi = {
*/
getRecommendBooks() {
return skeletonClient.request<IRecommendBooksResponse>({
url: 'bookAbroad/home/getRecommendBooks',
url: uni.getStorageSync('token') ? 'bookAbroad/home/getRecommendBooks' : 'visitor/bookAbroad/getRecommendBooks',
method: 'POST',
data: {}
})
@@ -54,7 +54,7 @@ export const bookHomeApi = {
*/
getBookLabelList(type: number) {
return skeletonClient.request<ILabelListResponse>({
url: 'bookAbroad/home/getBookAbroadLableList',
url: uni.getStorageSync('token') ? 'bookAbroad/home/getBookAbroadLableList' : 'visitor/bookAbroad//getBookAbroadLableList',
method: 'POST',
data: { type }
})
@@ -66,7 +66,7 @@ export const bookHomeApi = {
*/
getSubLabelList(pid: number) {
return skeletonClient.request<ILabelListResponse>({
url: 'bookAbroad/home/getBookAbroadLableListByPid',
url: uni.getStorageSync('token') ? 'bookAbroad/home/getBookAbroadLableListByPid' : 'visitor/bookAbroad//getBookAbroadLableListByPid',
method: 'POST',
data: { pid }
})
@@ -78,7 +78,7 @@ export const bookHomeApi = {
*/
getBooksByLabel(lableId: number) {
return skeletonClient.request<IBookListResponse>({
url: 'bookAbroad/home/getAbroadBookListByLable',
url: uni.getStorageSync('token') ? 'bookAbroad/home/getAbroadBookListByLable' : 'visitor/bookAbroad/getAbroadBookListByLable',
method: 'POST',
data: { lableId }
})