fix:banner image, setting page , cookies set
This commit is contained in:
parent
281f6cd82a
commit
718f1d9d8b
|
|
@ -11,12 +11,14 @@ export default function Settings() {
|
|||
const [profile, setProfile] = useState<any>();
|
||||
const uid = Cookies.get("uie");
|
||||
useEffect(() => {
|
||||
initFetch();
|
||||
}, []);
|
||||
if (!profile) {
|
||||
initFetch();
|
||||
}
|
||||
}, [profile]);
|
||||
const initFetch = async () => {
|
||||
loading();
|
||||
const profile = await getDetailMasterUsers(String(uid));
|
||||
// const profile = await getProfile();
|
||||
// const profile = await getDetailMasterUsers(String(uid));
|
||||
const profile = await getProfile();
|
||||
setProfile(profile?.data?.data);
|
||||
close();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -255,21 +255,18 @@ export default function Login() {
|
|||
Cookies.set("username", profile?.username, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("urie", profile?.roleId, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("roleName", profile?.roleName, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("masterPoldaId", profile?.masterPoldaId, {
|
||||
Cookies.set("urie", profile?.userRoleId, {
|
||||
expires: 1,
|
||||
});
|
||||
// Cookies.set("masterPoldaId", profile?.masterPoldaId, {
|
||||
// expires: 1,
|
||||
// });
|
||||
Cookies.set("ulne", profile?.userLevelId, {
|
||||
expires: 1,
|
||||
});
|
||||
Cookies.set("urce", profile?.roleCode, {
|
||||
expires: 1,
|
||||
});
|
||||
// Cookies.set("urce", profile?.data?.data?.roleCode, {
|
||||
// expires: 1,
|
||||
// });
|
||||
Cookies.set("email", profile?.email, {
|
||||
expires: 1,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -251,10 +251,10 @@ export default function HeaderNews() {
|
|||
{hotNews?.length > 0 ? (
|
||||
<Swiper
|
||||
centeredSlides={true}
|
||||
autoplay={{
|
||||
delay: 7000,
|
||||
disableOnInteraction: false,
|
||||
}}
|
||||
// autoplay={{
|
||||
// delay: 7000,
|
||||
// disableOnInteraction: false,
|
||||
// }}
|
||||
navigation={true}
|
||||
modules={[Autoplay, Controller, Navigation]}
|
||||
className="mySwiper"
|
||||
|
|
@ -285,8 +285,8 @@ export default function HeaderNews() {
|
|||
<div className="relative w-full h-[50vh] lg:h-[500px]">
|
||||
<Image
|
||||
alt="headernews"
|
||||
width={480}
|
||||
height={480}
|
||||
width={1080}
|
||||
height={1080}
|
||||
onLoad={(e) => handleImageLoad(e, index)}
|
||||
src={
|
||||
newsItem?.thumbnailUrl === ""
|
||||
|
|
@ -296,7 +296,7 @@ export default function HeaderNews() {
|
|||
className={`!object-cover !rounded-none ${
|
||||
portraitMap[index]
|
||||
? "!w-auto object-cover mx-auto"
|
||||
: "!w-[90vw]"
|
||||
: "w-full"
|
||||
} !h-[500px]`}
|
||||
/>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue