hookehuyr

fix: 修复银行账号在接口传输和存储时的类型转换问题

......@@ -494,7 +494,7 @@ const getUserInfo = async () => {
if (userInfo.bank_id && userInfo.bank_no) {
accountInfo.value = {
bankName: userInfo.bank_id, // 存储银行ID
bankAccount: userInfo.bank_no,
bankAccount: Number(userInfo.bank_no), // 从接口获取后转换为数字
bankImg: userInfo.bank_img || '' // 存储银行卡图片
};
}
......@@ -640,7 +640,7 @@ const saveAccountInfo = async () => {
// 调用API保存收款账号信息
const result = await updateProfileAPI({
bank_id: tempAccountInfo.value.bankName, // 发送银行ID
bank_no: tempAccountInfo.value.bankAccount,
bank_no: String(tempAccountInfo.value.bankAccount), // 转换为字符串传给接口
bank_img: tempAccountInfo.value.bankImg // 发送银行卡图片
});
......@@ -650,7 +650,7 @@ const saveAccountInfo = async () => {
// 更新全局用户状态
userStore.updateUserInfo({
bank_id: tempAccountInfo.value.bankName, // 存储银行ID
bank_no: tempAccountInfo.value.bankAccount,
bank_no: tempAccountInfo.value.bankAccount, // 保持数字类型存储到全局状态
bank_img: tempAccountInfo.value.bankImg // 存储银行卡图片
});
......