fix:banner image, setting page , cookies set

This commit is contained in:
Rama Priyanto 2025-06-12 21:59:50 +07:00
parent 281f6cd82a
commit 718f1d9d8b
3 changed files with 20 additions and 21 deletions

View File

@ -11,12 +11,14 @@ export default function Settings() {
const [profile, setProfile] = useState<any>(); const [profile, setProfile] = useState<any>();
const uid = Cookies.get("uie"); const uid = Cookies.get("uie");
useEffect(() => { useEffect(() => {
initFetch(); if (!profile) {
}, []); initFetch();
}
}, [profile]);
const initFetch = async () => { const initFetch = async () => {
loading(); loading();
const profile = await getDetailMasterUsers(String(uid)); // const profile = await getDetailMasterUsers(String(uid));
// const profile = await getProfile(); const profile = await getProfile();
setProfile(profile?.data?.data); setProfile(profile?.data?.data);
close(); close();
}; };

View File

@ -255,21 +255,18 @@ export default function Login() {
Cookies.set("username", profile?.username, { Cookies.set("username", profile?.username, {
expires: 1, expires: 1,
}); });
Cookies.set("urie", profile?.roleId, { Cookies.set("urie", profile?.userRoleId, {
expires: 1,
});
Cookies.set("roleName", profile?.roleName, {
expires: 1,
});
Cookies.set("masterPoldaId", profile?.masterPoldaId, {
expires: 1, expires: 1,
}); });
// Cookies.set("masterPoldaId", profile?.masterPoldaId, {
// expires: 1,
// });
Cookies.set("ulne", profile?.userLevelId, { Cookies.set("ulne", profile?.userLevelId, {
expires: 1, expires: 1,
}); });
Cookies.set("urce", profile?.roleCode, { // Cookies.set("urce", profile?.data?.data?.roleCode, {
expires: 1, // expires: 1,
}); // });
Cookies.set("email", profile?.email, { Cookies.set("email", profile?.email, {
expires: 1, expires: 1,
}); });

View File

@ -251,10 +251,10 @@ export default function HeaderNews() {
{hotNews?.length > 0 ? ( {hotNews?.length > 0 ? (
<Swiper <Swiper
centeredSlides={true} centeredSlides={true}
autoplay={{ // autoplay={{
delay: 7000, // delay: 7000,
disableOnInteraction: false, // disableOnInteraction: false,
}} // }}
navigation={true} navigation={true}
modules={[Autoplay, Controller, Navigation]} modules={[Autoplay, Controller, Navigation]}
className="mySwiper" className="mySwiper"
@ -285,8 +285,8 @@ export default function HeaderNews() {
<div className="relative w-full h-[50vh] lg:h-[500px]"> <div className="relative w-full h-[50vh] lg:h-[500px]">
<Image <Image
alt="headernews" alt="headernews"
width={480} width={1080}
height={480} height={1080}
onLoad={(e) => handleImageLoad(e, index)} onLoad={(e) => handleImageLoad(e, index)}
src={ src={
newsItem?.thumbnailUrl === "" newsItem?.thumbnailUrl === ""
@ -296,7 +296,7 @@ export default function HeaderNews() {
className={`!object-cover !rounded-none ${ className={`!object-cover !rounded-none ${
portraitMap[index] portraitMap[index]
? "!w-auto object-cover mx-auto" ? "!w-auto object-cover mx-auto"
: "!w-[90vw]" : "w-full"
} !h-[500px]`} } !h-[500px]`}
/> />