fix: 修改index数据来源
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 44s
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 44s
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
import { assetApi, realnameApi } from '@/api/index.js';
|
||||
import { deviceApi, realnameApi } from '@/api/index.js';
|
||||
import { useUserStore } from '@/store/index.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
@@ -55,11 +55,11 @@
|
||||
|
||||
const loadCards = async () => {
|
||||
try {
|
||||
const data = await assetApi.getInfo(userStore.state.identifier);
|
||||
const data = await deviceApi.getCards(userStore.state.identifier);
|
||||
if (data.cards && data.cards.length > 0) {
|
||||
list.splice(0, list.length, ...data.cards.map(card => ({
|
||||
iccid: card.iccid,
|
||||
category: card.carrier_name.includes('电信') ? '124' : card.carrier_name.includes('联通') ? '125' : '126',
|
||||
category: getCarrierCategory(card.carrier_name),
|
||||
isRealName: card.real_name_status === 1
|
||||
})));
|
||||
}
|
||||
@@ -68,6 +68,14 @@
|
||||
}
|
||||
};
|
||||
|
||||
const getCarrierCategory = (carrierName) => {
|
||||
if (!carrierName) return '126';
|
||||
if (carrierName.includes('电信')) return '124';
|
||||
if (carrierName.includes('联通')) return '125';
|
||||
if (carrierName.includes('移动')) return '126';
|
||||
return '126';
|
||||
};
|
||||
|
||||
const toReal = async (card) => {
|
||||
currentCard.value = card;
|
||||
currentModalIccid.value = card.iccid;
|
||||
|
||||
Reference in New Issue
Block a user