linkOptions.js 653 B

123456789101112131415161718192021222324
  1. import request from '@/utils/request'
  2. export const FIXED_JUMP_OPTIONS = [
  3. { label: '太古地产', value: '太古地产' },
  4. { label: '龙腾', value: '龙腾' }
  5. ]
  6. export async function fetchLinkOptions() {
  7. const [campaignRes, channelRes] = await Promise.all([
  8. request.get('/api/campaign/list'),
  9. request.get('/api/channel/list')
  10. ])
  11. return {
  12. campaignOptions: (campaignRes.data || []).map(item => ({
  13. label: `${item.id} - ${item.name}`,
  14. value: item.id
  15. })),
  16. channelOptions: (channelRes.data || []).map(item => ({
  17. label: `${item.id} - ${item.subName || item.name || '-'}`,
  18. value: item.id
  19. }))
  20. }
  21. }