fix:个人信息部分错误信息修复
This commit is contained in:
@@ -77,7 +77,7 @@ async function getDeviceList() {
|
||||
}));
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to fetch device list:', err);
|
||||
// console.error('Failed to fetch device list:', err);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -102,18 +102,18 @@ const getBase64 = (file: File): Promise<string> => {
|
||||
const getKYCStatus = async () => {
|
||||
try {
|
||||
const response = await fetchKYCStatus();
|
||||
console.log('KYC Response:', response);
|
||||
// console.log('KYC Response:', response);
|
||||
|
||||
// 检查响应数据结构
|
||||
if (response?.data?.rows && Array.isArray(response.data.rows) && response.data.rows.length > 0) {
|
||||
// 获取第一条记录
|
||||
const kycData = response.data.rows[0];
|
||||
console.log('KYC Data:', kycData);
|
||||
// console.log('KYC Data:', kycData);
|
||||
|
||||
if (kycData && kycData.status) {
|
||||
// 将状态转换为标准格式,不区分大小写
|
||||
const normalizedStatus = kycData.status.toUpperCase() as Api.KYC.KYCStatus;
|
||||
console.log('Normalized status:', normalizedStatus);
|
||||
// console.log('Normalized status:', normalizedStatus);
|
||||
|
||||
// 确保状态值有效
|
||||
if (['UNVERIFIED', 'PENDING', 'VERIFIED', 'REJECTED'].includes(normalizedStatus)) {
|
||||
@@ -134,7 +134,7 @@ const getKYCStatus = async () => {
|
||||
}
|
||||
|
||||
// 如果没有有效的状态数据,设置为默认值
|
||||
console.warn('Invalid or missing KYC status data:', response);
|
||||
// console.warn('Invalid or missing KYC status data:', response);
|
||||
kycStatus.value = 'UNVERIFIED';
|
||||
kycInfo.value = {
|
||||
status: 'UNVERIFIED',
|
||||
@@ -145,8 +145,8 @@ const getKYCStatus = async () => {
|
||||
};
|
||||
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch KYC status:', error);
|
||||
message.error(t('page.kyc.kycerror'));
|
||||
// console.error('Failed to fetch KYC status:', error);
|
||||
// message.error(t('page.kyc.kycerror'));
|
||||
// 发生错误时设置默认值
|
||||
kycStatus.value = 'UNVERIFIED';
|
||||
kycInfo.value = {
|
||||
@@ -184,8 +184,8 @@ const handleIdCardUpload: UploadProps['beforeUpload'] = async (file) => {
|
||||
message.success(t('page.kyc.picturesuc'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to upload ID card:', error);
|
||||
message.error(t('page.kyc.picturefal'));
|
||||
// console.error('Failed to upload ID card:', error);
|
||||
// message.error(t('page.kyc.picturefal'));
|
||||
} finally {
|
||||
idCardLoading.value = false;
|
||||
}
|
||||
@@ -216,8 +216,8 @@ const handlePhotoUpload: UploadProps['beforeUpload'] = async (file) => {
|
||||
message.success(t('page.kyc.picturesuc'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Failed to upload photo:', error);
|
||||
message.error(t('page.kyc.picturefal'));
|
||||
// console.error('Failed to upload photo:', error);
|
||||
// message.error(t('page.kyc.picturefal'));
|
||||
} finally {
|
||||
photoLoading.value = false;
|
||||
}
|
||||
@@ -250,8 +250,8 @@ const submitKYC = async () => {
|
||||
message.success(t('page.kyc.kycsubmit'));
|
||||
await getKYCStatus();
|
||||
} catch (error) {
|
||||
console.error('Failed to submit KYC:', error);
|
||||
message.error(t('page.kyc.submitfalse'));
|
||||
// console.error('Failed to submit KYC:', error);
|
||||
// message.error(t('page.kyc.submitfalse'));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ onMounted(async () => {
|
||||
|
||||
const userInfo = authStore.userInfo?.user;
|
||||
if (!userInfo) {
|
||||
message.error(t('page.profile.getUserInfoFailed'));
|
||||
// message.error(t('page.profile.getUserInfoFailed'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -150,8 +150,8 @@ onMounted(async () => {
|
||||
sex: userInfo.sex ?? '0'
|
||||
};
|
||||
} catch (error) {
|
||||
console.error('Failed to get user info:', error);
|
||||
message.error(t('page.profile.getUserInfoFailed'));
|
||||
// console.error('Failed to get user info:', error);
|
||||
// message.error(t('page.profile.getUserInfoFailed'));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -162,7 +162,7 @@ const handleSubmit = async () => {
|
||||
|
||||
const userId = authStore.userInfo?.user?.userId;
|
||||
if (!userId) {
|
||||
message.error(t('page.profile.getUserInfoFailed'));
|
||||
// message.error(t('page.profile.getUserInfoFailed'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,11 +207,11 @@ const handleSubmit = async () => {
|
||||
}
|
||||
message.success(t('page.profile.updateSuccess'));
|
||||
} else {
|
||||
message.error(t('page.profile.updateFailed'));
|
||||
// message.error(t('page.profile.updateFailed'));
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('表单验证失败:', error);
|
||||
message.error(t('page.profile.updateFailed'));
|
||||
// console.error('表单验证失败:', error);
|
||||
// message.error(t('page.profile.updateFailed'));
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
|
||||
@@ -154,8 +154,8 @@ async function handleSubmit() {
|
||||
|
||||
|
||||
} catch (error) {
|
||||
console.error('Reset password failed:', error);
|
||||
message.error(t('page.login.resetPwd.resetFailed'));
|
||||
// console.error('Reset password failed:', error);
|
||||
// message.error(t('page.login.resetPwd.resetFailed'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user