diff --git a/api/personal-center/index.ts b/api/personal-center/index.ts index 3a11a0c..50411a9 100644 --- a/api/personal-center/index.ts +++ b/api/personal-center/index.ts @@ -164,3 +164,17 @@ export const cancelSocialBind = (params: { type: number; openid: string }) => { export const userLogout = () => { return useDollarFetchRequest.del>('/prod-api/app-api/member/user/unregister-user', {}) } + +/** + * 获取钱包配置 + */ +export const getWalletConfig = () => { + return useDollarFetchRequest.get< + IResponse<{ + rechargeRate: number + commissionRate: number + withdrawRateOfRecharge: number + withdrawRateOfEarn: number + }> + >('/prod-api/app-api/pay/wallet/get-config', {}) +} diff --git a/components/withdraw/index.vue b/components/withdraw/index.vue index 5927387..fed7075 100644 --- a/components/withdraw/index.vue +++ b/components/withdraw/index.vue @@ -21,7 +21,7 @@
- 提示:收益金币提现正常收取平台手续费3%,如需将充值金币提现,选择“全部提现”选项,因涉及充值赠送金额,将收取155高额手续费,如果恶意套利提现,将提现审核不通过! + 提示:收益金币提现正常收取平台手续费{{ walletConfig?.withdrawRateOfEarn }}%,如需将充值金币提现,选择“全部提现”选项,因涉及充值赠送金额,将收取{{ walletConfig?.withdrawRateOfRecharge }}%高额手续费,如果恶意套利提现,将提现审核不通过!
diff --git a/composables/useFetchRequest.ts b/composables/useFetchRequest.ts index 033c776..9b72302 100644 --- a/composables/useFetchRequest.ts +++ b/composables/useFetchRequest.ts @@ -1,18 +1,20 @@ import { useFetch } from '#app' import type { UseFetchOptions } from '#app' import { isArray } from '~/utils/utils' +import useUserStore from '~/stores/user' const useServerRequest = async (url: string, opts?: UseFetchOptions) => { const token = useToken() const runtimeConfig = useRuntimeConfig() + const userStore = useUserStore() const defaultOptions: UseFetchOptions = { baseURL: runtimeConfig.public.apiBase, onRequest({ options }) { options.headers = options.headers || {} - if (token.value) { - options.headers.set('Authorization', `Bearer ${token.value}`) + if (token.value || userStore.token) { + options.headers.set('Authorization', `Bearer ${token.value || userStore.token}`) } }, onResponse({ response }) { diff --git a/pages/personal-Center/index/components/pay-records.vue b/pages/personal-Center/index/components/pay-records.vue index 7db9aa9..35203ff 100644 --- a/pages/personal-Center/index/components/pay-records.vue +++ b/pages/personal-Center/index/components/pay-records.vue @@ -17,7 +17,14 @@ @@ -51,6 +58,12 @@ } } getTradeRecords() + + // 点击分页 + const handeClickCurrent = (pageNo: number) => { + query.pageNo = pageNo + getTradeRecords() + }