feat: user can upload ID card info (#2040)

* feat:user can upload ID card(#1999)

Signed-off-by: baihhh <2542274498@qq.com>

* feat: user can upload ID card, add diff languages

Signed-off-by: baihhh <2542274498@qq.com>

---------

Signed-off-by: baihhh <2542274498@qq.com>
This commit is contained in:
Baihhh
2023-07-06 20:36:32 +08:00
committed by GitHub
parent 96250aa70a
commit bc1c4d32f0
14 changed files with 203 additions and 30 deletions

View File

@ -28,6 +28,9 @@ export const CropperDivModal = (props) => {
const [visible, setVisible] = useState(false);
const [confirmLoading, setConfirmLoading] = useState(false);
const {title} = props;
const {setTitle} = props;
const {tag} = props;
const {disabled} = props;
const {user} = props;
const {buttonText} = props;
const {organization} = props;
@ -59,8 +62,8 @@ export const CropperDivModal = (props) => {
}
// Setting.showMessage("success", "uploading...");
const extension = image.substring(image.indexOf("/") + 1, image.indexOf(";base64"));
const fullFilePath = `avatar/${user.owner}/${user.name}.${extension}`;
ResourceBackend.uploadResource(user.owner, user.name, "avatar", "CropperDivModal", fullFilePath, blob)
const fullFilePath = `${tag}/${user.owner}/${user.name}.${extension}`;
ResourceBackend.uploadResource(user.owner, user.name, tag, "CropperDivModal", fullFilePath, blob)
.then((res) => {
if (res.status === "ok") {
window.location.href = window.location.pathname;
@ -139,19 +142,19 @@ export const CropperDivModal = (props) => {
return (
<div>
<Button type="default" onClick={showModal}>
<Button type="default" onClick={showModal} disabled={disabled}>
{buttonText}
</Button>
<Modal
maskClosable={false}
title={title}
open={visible}
okText={i18next.t("user:Upload a photo")}
okText={title}
confirmLoading={confirmLoading}
onCancel={handleCancel}
width={600}
footer={
[<Button block key="submit" type="primary" onClick={handleOk}>{i18next.t("user:Set new profile picture")}</Button>]
[<Button block key="submit" type="primary" onClick={handleOk}>{setTitle}</Button>]
}
>
<Col style={{margin: "0px auto 60px auto", width: 1000, height: 350}}>