fix: 允许未登录用户浏览首页和商城,解决微信审核拒绝问题
移除首页和商城页的强制登录拦截,商城API改用公开请求, 用户可先浏览再自行选择登录。
This commit is contained in:
parent
d55be3dbcf
commit
495b46ec8b
@ -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) {
|
||||||
|
|||||||
@ -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'
|
||||||
|
|||||||
@ -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(() => {
|
||||||
|
|||||||
@ -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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user