修改上传图片安全验证问题
This commit is contained in:
@@ -206,11 +206,11 @@ const DownloadBill: React.FC = () => {
|
||||
}
|
||||
},
|
||||
fail: function (err) {
|
||||
console.error("文件下载失败:", err);
|
||||
console.warn("文件下载失败:", err);
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.warn(error);
|
||||
}
|
||||
};
|
||||
const handleDownloadBill = async () => {
|
||||
@@ -240,11 +240,11 @@ const DownloadBill: React.FC = () => {
|
||||
}
|
||||
},
|
||||
fail: function (err) {
|
||||
console.error("文件下载失败:", err);
|
||||
console.warn("文件下载失败:", err);
|
||||
},
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
console.warn(error);
|
||||
}
|
||||
};
|
||||
return (
|
||||
|
||||
@@ -82,15 +82,15 @@ const DownloadBillRecords: React.FC = () => {
|
||||
console.log('打开文档成功');
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('打开文档失败', err);
|
||||
console.warn('打开文档失败', err);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
console.error('下载失败,状态码:', res.statusCode);
|
||||
console.warn('下载失败,状态码:', res.statusCode);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('下载失败', err);
|
||||
console.warn('下载失败', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ const EditProfilePage: React.FC = () => {
|
||||
// city: user_data.city || "",
|
||||
// });
|
||||
// } catch (error) {
|
||||
// console.error("加载用户信息失败:", error);
|
||||
// console.warn("加载用户信息失败:", error);
|
||||
// Taro.showToast({
|
||||
// title: "加载用户信息失败",
|
||||
// icon: "error",
|
||||
@@ -169,9 +169,9 @@ const EditProfilePage: React.FC = () => {
|
||||
icon: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("头像上传失败:", error);
|
||||
console.warn("头像上传失败:", error);
|
||||
Taro.showToast({
|
||||
title: "头像上传失败",
|
||||
title: error.message,
|
||||
icon: "none",
|
||||
});
|
||||
}
|
||||
@@ -246,7 +246,7 @@ const EditProfilePage: React.FC = () => {
|
||||
icon: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("保存失败:", error);
|
||||
console.warn("保存失败:", error);
|
||||
Taro.showToast({
|
||||
title: "保存失败",
|
||||
icon: "error",
|
||||
@@ -307,7 +307,7 @@ const EditProfilePage: React.FC = () => {
|
||||
icon: "success",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("保存失败:", error);
|
||||
console.warn("保存失败:", error);
|
||||
Taro.showToast({
|
||||
title: "保存失败",
|
||||
icon: "error",
|
||||
@@ -438,7 +438,7 @@ const EditProfilePage: React.FC = () => {
|
||||
const phone = await UserService.parse_phone(e.detail.code);
|
||||
handle_field_edit("phone", phone);
|
||||
} catch (e) {
|
||||
console.error("解析手机号失败:", e);
|
||||
console.warn("解析手机号失败:", e);
|
||||
Taro.showToast({
|
||||
title: "解析手机号失败,请重试",
|
||||
icon: "none",
|
||||
@@ -564,9 +564,8 @@ const EditProfilePage: React.FC = () => {
|
||||
</View>
|
||||
<View className="item_right">
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.gender ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_value ${form_data.gender ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
{convert_db_gender_to_display(form_data.gender)}
|
||||
</Text>
|
||||
@@ -597,9 +596,8 @@ const EditProfilePage: React.FC = () => {
|
||||
</View>
|
||||
<View className="item_right">
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.birthday ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_value ${form_data.birthday ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
{form_data.birthday || "选择生日"}
|
||||
</Text>
|
||||
@@ -628,9 +626,8 @@ const EditProfilePage: React.FC = () => {
|
||||
</View>
|
||||
<View className="item_right">
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.personal_profile ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_value ${form_data.personal_profile ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
{form_data.personal_profile.replace(/\n/g, " ") ||
|
||||
"介绍一下自己"}
|
||||
@@ -661,17 +658,16 @@ const EditProfilePage: React.FC = () => {
|
||||
</View>
|
||||
<View className="item_right">
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.province ||
|
||||
className={`item_value ${form_data.province ||
|
||||
form_data.city ||
|
||||
form_data.district
|
||||
? ""
|
||||
: "placehoder"
|
||||
}`}
|
||||
? ""
|
||||
: "placehoder"
|
||||
}`}
|
||||
>
|
||||
{form_data.province ||
|
||||
form_data.city ||
|
||||
form_data.district
|
||||
form_data.city ||
|
||||
form_data.district
|
||||
? `${form_data.province} ${form_data.city} ${form_data.district}`
|
||||
: "选择所在地区"}
|
||||
</Text>
|
||||
@@ -697,9 +693,8 @@ const EditProfilePage: React.FC = () => {
|
||||
</View>
|
||||
<View className="item_right">
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.ntrp_level ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_value ${form_data.ntrp_level ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
{form_data.ntrp_level || "测测你的 NTRP 水平"}
|
||||
</Text>
|
||||
@@ -724,14 +719,12 @@ const EditProfilePage: React.FC = () => {
|
||||
<Text className="item_label">职业</Text>
|
||||
</View>
|
||||
<View
|
||||
className={`item_right ${
|
||||
form_data.occupation ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_right ${form_data.occupation ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
<Text
|
||||
className={`item_value ${
|
||||
form_data.occupation ? "" : "placeholder"
|
||||
}`}
|
||||
className={`item_value ${form_data.occupation ? "" : "placeholder"
|
||||
}`}
|
||||
>
|
||||
{form_data.occupation || "填写你的职业"}
|
||||
</Text>
|
||||
@@ -771,9 +764,9 @@ const EditProfilePage: React.FC = () => {
|
||||
>
|
||||
{form_data.phone
|
||||
? form_data.phone.replace(
|
||||
/(\d{3})(\d{4})(\d{4})/,
|
||||
"$1 $2 $3"
|
||||
)
|
||||
/(\d{3})(\d{4})(\d{4})/,
|
||||
"$1 $2 $3"
|
||||
)
|
||||
: "未绑定"}
|
||||
</Button>
|
||||
<Image
|
||||
|
||||
@@ -85,7 +85,7 @@ const FollowPage: React.FC = () => {
|
||||
}));
|
||||
|
||||
} catch (error) {
|
||||
console.error(`加载${TAB_CONFIG.find(t => t.key === tab)?.label}列表失败:`, error);
|
||||
console.warn(`加载${TAB_CONFIG.find(t => t.key === tab)?.label}列表失败:`, error);
|
||||
Taro.showToast({
|
||||
title: '加载失败',
|
||||
icon: 'none'
|
||||
@@ -163,7 +163,7 @@ const FollowPage: React.FC = () => {
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('关注操作失败:', error);
|
||||
console.warn('关注操作失败:', error);
|
||||
Taro.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'none'
|
||||
@@ -202,7 +202,7 @@ const FollowPage: React.FC = () => {
|
||||
try {
|
||||
load_user_list(default_tab, true);
|
||||
} catch (error) {
|
||||
console.error('初始化加载失败:', error);
|
||||
console.warn('初始化加载失败:', error);
|
||||
Taro.showToast({
|
||||
title: '初始化失败',
|
||||
icon: 'none'
|
||||
@@ -243,7 +243,7 @@ const FollowPage: React.FC = () => {
|
||||
// icon: 'success'
|
||||
// });
|
||||
} catch (error) {
|
||||
console.error('取消关注失败:', error);
|
||||
console.warn('取消关注失败:', error);
|
||||
Taro.showToast({
|
||||
title: '操作失败',
|
||||
icon: 'none'
|
||||
|
||||
@@ -62,7 +62,7 @@ const MyselfPage: React.FC = () => {
|
||||
// // }
|
||||
// // set_game_records(games_data);
|
||||
// } catch (error) {
|
||||
// console.error("加载用户数据失败:", error);
|
||||
// console.warn("加载用户数据失败:", error);
|
||||
// Taro.showToast({
|
||||
// title: "加载失败,请重试",
|
||||
// icon: "error",
|
||||
@@ -150,7 +150,7 @@ const MyselfPage: React.FC = () => {
|
||||
setEndedGameRecords(finishedGames);
|
||||
// set_game_records(games_data);
|
||||
} catch (error) {
|
||||
console.error("加载球局数据失败:", error);
|
||||
console.warn("加载球局数据失败:", error);
|
||||
}
|
||||
}, [active_tab, user_info, classifyGameRecords]);
|
||||
|
||||
@@ -176,7 +176,7 @@ const MyselfPage: React.FC = () => {
|
||||
duration: 1500,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("关注操作失败:", error);
|
||||
console.warn("关注操作失败:", error);
|
||||
Taro.showToast({
|
||||
title: "操作失败,请重试",
|
||||
icon: "error",
|
||||
|
||||
@@ -117,7 +117,7 @@ const OtherUserPage: React.FC = () => {
|
||||
});
|
||||
setIsFollowing(userData.is_following || false);
|
||||
} catch (error) {
|
||||
console.error("加载用户数据失败:", error);
|
||||
console.warn("加载用户数据失败:", error);
|
||||
Taro.showToast({
|
||||
title: "加载失败",
|
||||
icon: "none",
|
||||
@@ -169,7 +169,7 @@ const OtherUserPage: React.FC = () => {
|
||||
setGameRecords(notEndGames);
|
||||
setEndedGameRecords(finishedGames);
|
||||
} catch (error) {
|
||||
console.error("加载球局数据失败:", error);
|
||||
console.warn("加载球局数据失败:", error);
|
||||
Taro.showToast({
|
||||
title: "加载失败,请重试",
|
||||
icon: "error",
|
||||
@@ -200,7 +200,7 @@ const OtherUserPage: React.FC = () => {
|
||||
duration: 1500,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("关注操作失败:", error);
|
||||
console.warn("关注操作失败:", error);
|
||||
Taro.showToast({
|
||||
title: "操作失败",
|
||||
icon: "none",
|
||||
@@ -235,7 +235,7 @@ const OtherUserPage: React.FC = () => {
|
||||
try {
|
||||
await Promise.all([load_user_data(), load_game_data()]);
|
||||
} catch (error) {
|
||||
console.error("刷新失败:", error);
|
||||
console.warn("刷新失败:", error);
|
||||
} finally {
|
||||
setRefreshing(false);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ const QueryTransactions = () => {
|
||||
setSearchHistory(response.data);
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
console.warn(e);
|
||||
}
|
||||
};
|
||||
/**
|
||||
|
||||
@@ -195,7 +195,7 @@ const WalletPage: React.FC = () => {
|
||||
const res = await httpService.post("/wallet/check_password_status");
|
||||
set_password_status(res.data.is_password_set);
|
||||
} catch (e) {
|
||||
console.error("检查交易密码状态失败:", e);
|
||||
console.warn("检查交易密码状态失败:", e);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -218,7 +218,7 @@ const WalletPage: React.FC = () => {
|
||||
total_withdraw,
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error("加载钱包数据失败:", error);
|
||||
console.warn("加载钱包数据失败:", error);
|
||||
|
||||
let errorMessage = "加载失败,请重试";
|
||||
if (
|
||||
@@ -262,7 +262,7 @@ const WalletPage: React.FC = () => {
|
||||
set_transactions([]);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error("加载交易记录失败:", error);
|
||||
console.warn("加载交易记录失败:", error);
|
||||
set_transactions([]);
|
||||
|
||||
let errorMessage = "加载交易记录失败";
|
||||
|
||||
@@ -135,7 +135,7 @@ const Withdrawal: React.FC = () => {
|
||||
total_withdraw,
|
||||
});
|
||||
} catch (error: any) {
|
||||
console.error("加载钱包数据失败:", error);
|
||||
console.warn("加载钱包数据失败:", error);
|
||||
|
||||
let errorMessage = "加载失败,请重试";
|
||||
if (
|
||||
@@ -171,7 +171,7 @@ const Withdrawal: React.FC = () => {
|
||||
setMapErrorCodes(mapErrorCodes);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error("获取提现错误码失败:", error);
|
||||
console.warn("获取提现错误码失败:", error);
|
||||
}
|
||||
};
|
||||
const handleWithdraw = async () => {
|
||||
|
||||
Reference in New Issue
Block a user