update FilePreview.tsx, TypeUploadSingle.tsx, user.ts and package.json
This commit is contained in:
parent
34fdaa0cf5
commit
98598fa984
|
|
@ -211,12 +211,16 @@ export const FilePreview = ({ url }: { url: any }) => {
|
|||
{file.extension && (
|
||||
<div
|
||||
className={cx(
|
||||
"flex border rounded items-center px-1 bg-white cursor-pointer flex-grow",
|
||||
"flex rounded items-center px-1 bg-white cursor-pointer flex-grow hover:bg-gray-100 gap-x-1",
|
||||
"pr-2",
|
||||
css`
|
||||
&:hover {
|
||||
border: 1px solid #1c4ed8;
|
||||
outline: 1px solid #1c4ed8;
|
||||
// border: 1px solid #1c4ed8;
|
||||
// outline: 1px solid #1c4ed8;
|
||||
}
|
||||
&:hover {
|
||||
// border-bottom: 1px solid #1c4ed8;
|
||||
// outline: 1px solid #1c4ed8;
|
||||
}
|
||||
`
|
||||
)}
|
||||
|
|
@ -227,7 +231,9 @@ export const FilePreview = ({ url }: { url: any }) => {
|
|||
window.open(_url, "_blank");
|
||||
}}
|
||||
>
|
||||
{content}
|
||||
<div className="h-[30px] flex flex-row items-center">{content}</div>
|
||||
<div className="text-xs filename">{file?.name}</div>
|
||||
|
||||
<div className="ml-2">
|
||||
<ExternalLink size="12px" />
|
||||
</div>
|
||||
|
|
@ -287,6 +293,7 @@ const getFileName = (url: string) => {
|
|||
}
|
||||
|
||||
const fileName = url.substring(url.lastIndexOf("/") + 1);
|
||||
console.log({ fileName });
|
||||
const dotIndex = fileName.lastIndexOf(".");
|
||||
const fullname = fileName;
|
||||
if (dotIndex === -1) {
|
||||
|
|
|
|||
|
|
@ -6,26 +6,28 @@ export const userToken = async () => {
|
|||
if (user) {
|
||||
const w = window as any;
|
||||
w.user = JSON.parse(user);
|
||||
}else{
|
||||
const res = await api.get(`${process.env.NEXT_PUBLIC_API_PORTAL}/api/check-jwt-token`);
|
||||
const jwt = res.data.data;
|
||||
console.log({jwt})
|
||||
if (!jwt) return ;
|
||||
} else {
|
||||
try {
|
||||
await api.post(process.env.NEXT_PUBLIC_BASE_URL + "/api/cookies", {
|
||||
token: jwt,
|
||||
});
|
||||
const user = await api.get(
|
||||
`${process.env.NEXT_PUBLIC_API_PORTAL}/api/users/me`
|
||||
const res = await api.get(
|
||||
`${process.env.NEXT_PUBLIC_API_PORTAL}/api/check-jwt-token`
|
||||
);
|
||||
const us = user.data.data;
|
||||
console.log({us})
|
||||
if (us) {
|
||||
localStorage.setItem("user", JSON.stringify(user.data.data));
|
||||
const roles = await userRoleMe();
|
||||
}
|
||||
} catch (e) {
|
||||
}
|
||||
console.log({res})
|
||||
const jwt = res.data.data;
|
||||
console.log({ jwt });
|
||||
if (!jwt) return;
|
||||
try {
|
||||
await api.post(process.env.NEXT_PUBLIC_BASE_URL + "/api/cookies", {
|
||||
token: jwt,
|
||||
});
|
||||
const user = await api.get(
|
||||
`${process.env.NEXT_PUBLIC_API_PORTAL}/api/users/me`
|
||||
);
|
||||
const us = user.data.data;
|
||||
console.log({ us });
|
||||
if (us) {
|
||||
localStorage.setItem("user", JSON.stringify(user.data.data));
|
||||
const roles = await userRoleMe();
|
||||
}
|
||||
} catch (e) {}
|
||||
} catch (ex) {}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@
|
|||
"lodash.uniqby": "^4.7.0",
|
||||
"lucide-react": "^0.462.0",
|
||||
"next": "15.0.3",
|
||||
"react-beautiful-dnd": "^13.1.1",
|
||||
"react-colorful": "^5.6.1",
|
||||
"react-icons": "^5.3.0",
|
||||
"react-resizable": "^3.0.5",
|
||||
|
|
@ -61,6 +62,7 @@
|
|||
"devDependencies": {
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-beautiful-dnd": "^13.1.8",
|
||||
"@types/react-dom": "^18",
|
||||
"@types/react-resizable": "^3.0.8",
|
||||
"@types/react-slick": "^0.23.13",
|
||||
|
|
|
|||
Loading…
Reference in New Issue