Bug fixed
parent
7caef19713
commit
d97c13b565
|
|
@ -166,10 +166,9 @@ export default function ComplainsDetails({
|
|||
|
||||
const checkKey2 = (item: any) => {
|
||||
const dcKey = Decrypt(item.cipherKeyInspector, selectedFile);
|
||||
|
||||
console.log(dcKey);
|
||||
if (dcKey != false && dcKey != null) {
|
||||
if (check) {
|
||||
localStorage.setItem("privatePassword", dcKey);
|
||||
localStorage.setItem("privateKey", selectedFile);
|
||||
}
|
||||
localStorage.setItem("trackingNumber", item.trackingNumber);
|
||||
|
|
|
|||
|
|
@ -85,10 +85,17 @@ export default function InspectorOperations({
|
|||
toast("عملیات شما با موفقیت انجام شد. ", {
|
||||
className: "!bg-green-500 !text-white",
|
||||
});
|
||||
const tk = localStorage.getItem("trackingNumber");
|
||||
// const tk = localStorage.getItem("trackingNumber");
|
||||
const storedData = JSON.parse(
|
||||
localStorage.getItem("CompliantData") as string
|
||||
);
|
||||
const dcKey = Decrypt(
|
||||
storedData.cipherKeyInspector,
|
||||
localStorage.getItem("privateKey") as string
|
||||
);
|
||||
updateData({
|
||||
trackingNumber: complaintData.trackingNumber,
|
||||
password: key2 ? key2 : (localStorage.getItem("privateKey") as string),
|
||||
password: key2 ? key2 : dcKey,
|
||||
});
|
||||
},
|
||||
onError: (err: any | string) => {
|
||||
|
|
@ -102,7 +109,10 @@ export default function InspectorOperations({
|
|||
const storedData = JSON.parse(
|
||||
localStorage.getItem("CompliantData") as string
|
||||
);
|
||||
const dcKey = Decrypt(storedData.cipherKeyInspector, key2);
|
||||
const dcKey = Decrypt(
|
||||
storedData.cipherKeyInspector,
|
||||
localStorage.getItem("privateKey") as string
|
||||
);
|
||||
const formData = new FormData();
|
||||
formData.append("text", data.text);
|
||||
formData.append("trackingNumber", complaintData.trackingNumber);
|
||||
|
|
@ -110,10 +120,7 @@ export default function InspectorOperations({
|
|||
if (data.type) {
|
||||
formData.append("IsPublic", data.type == "public" ? "true" : "false");
|
||||
}
|
||||
formData.append(
|
||||
"EncodedKey",
|
||||
key2 ? key2 : (localStorage.getItem("privateKey") as string)
|
||||
);
|
||||
formData.append("EncodedKey", key2 ? key2 : dcKey);
|
||||
if (data?.media && data?.media?.length > 0) {
|
||||
for (let i = 0; i < data.media.length; i++) {
|
||||
formData.append("Medias", data.media[i]);
|
||||
|
|
|
|||
|
|
@ -134,6 +134,7 @@ export async function RefreshToken(payload: { token: any; refreshToken: any }) {
|
|||
} catch (error) {
|
||||
deleteCookie("Sootzani_Token");
|
||||
deleteCookie("Sootzani_Refresh_Token");
|
||||
localStorage.removeItem("privateKey");
|
||||
window.location.href = "/";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue