渠道接口换

This commit is contained in:
2026-06-24 14:18:12 +08:00
parent 7010ed1238
commit e14dd66e2b
2 changed files with 3 additions and 36 deletions

View File

@ -139,7 +139,7 @@ import { ref, computed, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
import Dialog from '@/components/common/Dialog.vue'
import { getWalletCapital, getWithdrawChannel, getAgentWithdrawChannel, agentWithdraw, withdraw } from '@/api/modules/capital/withdraw'
import { getWalletCapital, agentWithdraw, withdraw } from '@/api/modules/capital/withdraw'
import { getStorage } from '@/utils/storage'
const { t } = useI18n()
@ -182,11 +182,6 @@ interface WalletInfo {
closing_profit: string
}
interface ChannelItem {
id: number
name: string
}
interface CalculatedItem {
type: string
typeLabel: string
@ -354,9 +349,6 @@ const walletInfo = ref<WalletInfo>({
closing_profit: '0',
})
//
const channelList = ref<ChannelItem[]>([])
//
const calculatedData = ref<CalculatedItem[]>([])
@ -452,31 +444,6 @@ const initData = async () => {
} catch (error) {
console.error('获取钱包信息失败', error)
}
//
try {
const api = isAgent.value ? getWithdrawChannel : getAgentWithdrawChannel
const res: any = await api()
if (res && Array.isArray(res)) {
channelList.value = res.map((item: any) => ({
id: item.id,
name: item.name,
channel_code: item.channel_code || '',
}))
} else if (res?.data) {
channelList.value = res.data.map((item: any) => ({
id: item.id,
name: item.name,
channel_code: item.channel_code || '',
}))
}
//
if (channelList.value.length > 0) {
currentChannelCode.value = channelList.value[0].channel_code || ''
}
} catch (error) {
console.error('获取渠道列表失败', error)
}
}
//

View File

@ -370,7 +370,7 @@ import {
updateCapital,
editAgentBail,
} from '@/api/modules/profile/business.ts'
import { getAgentWithdrawChannel, agentWithdraw } from '@/api/modules/capital/withdraw'
import { getWithdrawChannel, agentWithdraw } from '@/api/modules/capital/withdraw'
const userStore = useUserStore()
@ -734,7 +734,7 @@ const withdrawChannelOptions = ref<{ label: string; value: number }[]>([])
//
const fetchWithdrawChannel = async () => {
try {
const res = await getAgentWithdrawChannel()
const res = await getWithdrawChannel()
withdrawChannelOptions.value = res.map((item: any) => ({
label: item.name,
value: item.id,