fix: 允许未登录用户浏览首页和商城,解决微信审核拒绝问题

移除首页和商城页的强制登录拦截,商城API改用公开请求,
用户可先浏览再自行选择登录。
This commit is contained in:
Zuncle 2026-03-24 17:11:03 +08:00
parent d55be3dbcf
commit 495b46ec8b
4 changed files with 11 additions and 22 deletions

View File

@ -251,12 +251,12 @@ export function getStoreItems(kind = 'product', page = 1, page_size = 20, filter
if (filters.category_id !== undefined && filters.category_id !== null && filters.category_id > 0) { if (filters.category_id !== undefined && filters.category_id !== null && filters.category_id > 0) {
data.category_id = filters.category_id data.category_id = filters.category_id
} }
return authRequest({ url: '/api/app/store/items', method: 'GET', data }) return request({ url: '/api/app/store/items', method: 'GET', data })
} }
export function getProductCategories() { export function getProductCategories() {
return authRequest({ url: '/api/app/product_categories', method: 'GET' }) return request({ url: '/api/app/product_categories', method: 'GET' })
} }
export function getTasks(page = 1, page_size = 20) { export function getTasks(page = 1, page_size = 20) {

View File

@ -256,7 +256,7 @@ import { onShow, onReachBottom, onShareAppMessage, onPullDownRefresh } from '@dc
import { getInventory, getProductDetail, redeemInventory, requestShipping, cancelShipping, listAddresses, getShipments, createAddressShare, createShippingFeeOrder } from '@/api/appUser' import { getInventory, getProductDetail, redeemInventory, requestShipping, cancelShipping, listAddresses, getShipments, createAddressShare, createShippingFeeOrder } from '@/api/appUser'
import { getSynthesisRecipes, doSynthesis } from '@/api/synthesis.js' import { getSynthesisRecipes, doSynthesis } from '@/api/synthesis.js'
import { vibrateShort } from '@/utils/vibrate.js' import { vibrateShort } from '@/utils/vibrate.js'
import { checkPhoneBound, checkPhoneBoundSync } from '@/utils/checkPhone.js' import { checkPhoneBoundSync } from '@/utils/checkPhone.js'
import { executePaymentFlow } from '@/utils/payment.js' import { executePaymentFlow } from '@/utils/payment.js'
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue' import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue'

View File

@ -144,7 +144,6 @@
<script> <script>
import { authRequest, request } from '../../utils/request.js' import { authRequest, request } from '../../utils/request.js'
import SplashScreen from '@/components/SplashScreen.vue' import SplashScreen from '@/components/SplashScreen.vue'
import { checkPhoneBound, checkPhoneBoundSync } from '../../utils/checkPhone.js'
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue' import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue'
// #endif // #endif
@ -212,9 +211,6 @@ export default {
return return
// #endif // #endif
// ()
if (!checkPhoneBoundSync()) return
// 200ms Token/Session // 200ms Token/Session
// //
setTimeout(() => { setTimeout(() => {

View File

@ -167,7 +167,6 @@
import { onShow, onReachBottom } from '@dcloudio/uni-app' import { onShow, onReachBottom } from '@dcloudio/uni-app'
import { ref, watch, onUnmounted } from 'vue' import { ref, watch, onUnmounted } from 'vue'
import { getStoreItems, redeemProductByPoints, redeemCouponByPoints, redeemItemCardByPoints, getProductCategories } from '../../api/appUser' import { getStoreItems, redeemProductByPoints, redeemCouponByPoints, redeemItemCardByPoints, getProductCategories } from '../../api/appUser'
import { checkPhoneBound, checkPhoneBoundSync } from '../../utils/checkPhone.js'
import { vibrateShort } from '@/utils/vibrate.js' import { vibrateShort } from '@/utils/vibrate.js'
// #ifdef MP-TOUTIAO // #ifdef MP-TOUTIAO
import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue' import customTabBarToutiao from '@/components/app-tab-bar-toutiao.vue'
@ -545,20 +544,14 @@ function onCategorySelect(id) {
} }
onShow(() => { onShow(() => {
// //
if (!checkPhoneBoundSync()) return if (!hasInitialized) {
page.value = 1
const token = uni.getStorageSync('token') hasMore.value = true
if (token) { allItems.value = []
// loadItems()
if (!hasInitialized) { fetchCategories()
page.value = 1 hasInitialized = true
hasMore.value = true
allItems.value = []
loadItems()
fetchCategories()
hasInitialized = true
}
} }
}) })