feature: use md5

This commit is contained in:
antv
2026-07-06 14:00:07 +07:00
parent d8f0e48bf3
commit b1beed4ae6
4 changed files with 71 additions and 76 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ class AdminService implements AdminServiceInterface
'msnv' => $data['msnv'],
'name' => $data['name'],
'mail' => $data['mail'],
'pass' => Hash::make($data['password']),
'pass' => md5($data['password']),
'departments' => $data['departments'],
'role' => $data['role'],
'status' => User::STATUS_ACTIVE,
+1 -1
View File
@@ -90,7 +90,7 @@ class UserService implements UserServiceInterface
public function updatePassword(User $user, string $newPassword): void
{
$user->pass = Hash::make($newPassword);
$user->pass = md5($newPassword);
$user->first_login = User::FIRST_LOGIN_FALSE;
$user->save();
}
+55 -67
View File
@@ -4,8 +4,7 @@
@section('content')
<div class="max-w-[1280px] mx-auto w-full pb-10 px-2 lg:px-8">
<!-- Welcome Section -->
<div class="mb-6 pl-1">
<h1 class="text-[28px] font-extrabold text-[#1a2b49] flex items-center gap-2 mb-1.5 tracking-tight">
Hey {{ Auth::check() ? (Auth::user()->name ?? 'Minh Anh') : 'Minh Anh' }}! <span class="text-2xl animate-bounce">👋</span>
@@ -13,16 +12,14 @@
<p class="text-gray-500 font-medium text-[14px]">Cảm ơn bạn đã góp phần tạo nên một tập thể tuyệt vời!</p>
</div>
<!-- Row 1: Hero -->
<div class="mb-6">
<x-hero-banner />
</div>
<!-- Row 2: Statistics -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-8">
<x-stat-card
title="Thanks đã nhận"
value="128"
<x-stat-card
title="Thanks đã nhận"
value="128"
iconBgClass="bg-purple-50"
iconColorClass="text-purple-500">
<svg class="w-[26px] h-[26px]" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8">
@@ -30,9 +27,9 @@
</svg>
</x-stat-card>
<x-stat-card
title="Thanks đã gửi"
value="82"
<x-stat-card
title="Thanks đã gửi"
value="82"
iconBgClass="bg-blue-50"
iconColorClass="text-blue-500">
<svg class="w-[26px] h-[26px] transform -rotate-45" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8">
@@ -41,9 +38,9 @@
</x-stat-card>
<x-stat-card
title="Thứ hạng"
value="#5"
<x-stat-card
title="Thứ hạng"
value="#5"
iconBgClass="bg-green-50"
iconColorClass="text-green-500">
<svg class="w-[26px] h-[26px]" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="1.8">
@@ -52,66 +49,59 @@
</x-stat-card>
</div>
<!-- Row 3: Thanks Grid & Ranking -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 lg:gap-12 items-start">
<!-- LEFT COLUMN: Thanks & Tip (Left 2/3) -->
<div class="col-span-1 lg:col-span-2 flex flex-col flex-1 h-full gap-6">
<!-- Recent Thanks Card -->
<div class="flex flex-col gap-6 lg:flex-row lg:items-start lg:gap-8">
<div class="flex-1 min-w-0 flex flex-col gap-6">
<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 flex flex-col">
<div class="flex items-center justify-between mb-4 pl-1 pr-1">
<h3 class="text-[17px] font-extrabold text-[#1a2b49]">Thanks gần đây</h3>
<a href="{{ route('user.received') }}" class="text-[13px] font-bold text-[#3462f7] hover:text-blue-800">Xem tất cả</a>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-4 flex-1">
<x-thank-card
title="GREAT JOB!"
message="Cảm ơn bạn đã luôn nhiệt tình giúp đỡ và đồng hành cùng mọi người. Chúc bạn một ngày làm việc thật vui vẻ và tràn đầy năng lượng!"
:isLiked="false"
bgClass="bg-gradient-to-br from-[#FFFDF7] to-[#FFF5DD]"
titleColorClass="text-[#FFB800]"
textColorClass="text-[#4B5563]"
/>
<x-thank-card
title="YOU ROCK!"
message="Sự cống hiến và tinh thần làm việc trách nhiệm của bạn luôn là nguồn cảm hứng lớn. Cảm ơn vì những nỗ lực không ngừng nghỉ của bạn!"
:isLiked="true"
bgClass="bg-gradient-to-br from-[#FCFAFF] to-[#F5F0FF]"
titleColorClass="text-[#8B5CF6]"
textColorClass="text-[#4B5563]"
/>
<x-thank-card
title="THANK YOU!"
message="Rất vui và may mắn khi được làm việc cùng một người đồng nghiệp tuyệt vời. Cảm ơn bạn vì tất cả những đóng góp tích cực cho tập thể!"
:isLiked="false"
bgClass="bg-gradient-to-br from-[#FBFEFF] to-[#EDF8FF]"
titleColorClass="text-[#4DA6FF]"
textColorClass="text-[#4B5563]"
/>
<x-thank-card
title="GREAT JOB!"
message="Cảm ơn bạn đã luôn nhiệt tình giúp đỡ và đồng hành cùng mọi người. Chúc bạn một ngày làm việc thật vui vẻ và tràn đầy năng lượng!"
:isLiked="false"
bgClass="bg-gradient-to-br from-[#FFFDF7] to-[#FFF5DD]"
titleColorClass="text-[#FFB800]"
textColorClass="text-[#4B5563]"
/>
<x-thank-card
title="YOU ROCK!"
message="Sự cống hiến và tinh thần làm việc trách nhiệm của bạn luôn là nguồn cảm hứng lớn. Cảm ơn vì những nỗ lực không ngừng nghỉ của bạn!"
:isLiked="true"
bgClass="bg-gradient-to-br from-[#FCFAFF] to-[#F5F0FF]"
titleColorClass="text-[#8B5CF6]"
textColorClass="text-[#4B5563]"
/>
<x-thank-card
title="THANK YOU!"
message="Rất vui và may mắn khi được làm việc cùng một người đồng nghiệp tuyệt vời. Cảm ơn bạn vì tất cả những đóng góp tích cực cho tập thể!"
:isLiked="false"
bgClass="bg-gradient-to-br from-[#FBFEFF] to-[#EDF8FF]"
titleColorClass="text-[#4DA6FF]"
textColorClass="text-[#4B5563]"
/>
</div>
</div>
<div class="w-full">
<x-info-card />
</div>
</div>
<!-- Info Tip Card -->
<div class="w-full">
<x-info-card />
</div>
<!-- Ranking (Right 1/3) -->
<div class="col-span-1 flex flex-col w-full flex-1 h-full">
<!-- Ranking Card -->
<div class="w-full lg:w-[380px] lg:flex-shrink-0 flex flex-col gap-6">
<div class="bg-white rounded-[24px] shadow-[0_10px_30px_rgba(15,23,42,0.05)] p-6 flex flex-col h-full">
<div class="flex items-center justify-between mb-3 pl-1 pr-1">
<h3 class="text-[17px] font-extrabold text-[#1a2b49]">Bảng xếp hạng</h3>
<a href="{{ route('user.ranking') }}" class="text-[13px] font-bold text-[#3462f7] hover:text-blue-800">Xem tất cả</a>
</div>
<!-- Tabs Toggle -->
<div class="inline-flex bg-[#F5F7FB] rounded-xl p-1 mb-4 w-fit space-x-2">
<button id="tab-received" onclick="switchRankingTab('received')" class="flex items-center justify-center gap-2 w-[120px] py-2 rounded-[10px] transition-all bg-white shadow-[0_2px_4px_rgba(0,0,0,0.04)] text-[#3462f7] font-bold text-[14px]">
<svg class="w-[18px] h-[18px]" fill="currentColor" viewBox="0 0 24 24">
@@ -129,25 +119,23 @@
</button>
</div>
<!-- Tab Content: Received -->
<div id="ranking-received" class="flex-1 flex flex-col mb-2">
<x-ranking-item rank="1" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=fef3c7" score="95" unit="thẻ" />
<x-ranking-item rank="2" name="Trần Hoàng Nam" team="Dev Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Nam&backgroundColor=e2e8f0" score="82" unit="thẻ" />
<x-ranking-item rank="3" name="Phạm Đức Huy" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Huy&backgroundColor=e2e8f0" score="67" unit="thẻ" />
<div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
<x-ranking-item rank="5" name="{{ Auth::check() ? (Auth::user()->name ?? 'Nguyễn Minh Anh') : 'Nguyễn Minh Anh' }}" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed={{ Auth::id() ?? 'MinhAnh' }}&backgroundColor=bfdbfe" score="45" unit="thẻ" :isCurrent="true" />
</div>
<!-- Tab Content: Sent -->
<div id="ranking-sent" class="flex-1 flex flex-col mb-2 hidden">
<x-ranking-item rank="1" name="Nguyễn Văn Lâm" team="HR Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Lam&backgroundColor=fef3c7" score="88" unit="thẻ" />
<x-ranking-item rank="2" name="Phạm Thu Thủy" team="Admin Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Thuy&backgroundColor=e2e8f0" score="75" unit="thẻ" />
<x-ranking-item rank="2" name="Phạm Thu Thủy" team="Admin Team" avatar="https://api.dicebear.com/7.x:notionists/svg?seed=Thuy&backgroundColor=e2e8f0" score="75" unit="thẻ" />
<x-ranking-item rank="3" name="Lê Quỳnh Chi" team="Marketing Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed=Chi&backgroundColor=e2e8f0" score="64" unit="thẻ" />
<div class="my-3 border-t border-dashed border-gray-100 mx-2"></div>
<x-ranking-item rank="12" name="{{ Auth::check() ? (Auth::user()->name ?? 'Nguyễn Minh Anh') : 'Nguyễn Minh Anh' }}" team="Product Team" avatar="https://api.dicebear.com/7.x/notionists/svg?seed={{ Auth::id() ?? 'MinhAnh' }}&backgroundColor=bfdbfe" score="18" unit="thẻ" :isCurrent="true" />
</div>
</div>
+14 -7
View File
@@ -28,7 +28,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 1001,
'name' => 'User A',
'mail' => 'usera@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -40,7 +41,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 1002,
'name' => 'User B',
'mail' => 'userb@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -106,7 +108,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 1001,
'name' => 'User A',
'mail' => 'usera@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -162,7 +165,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 2001,
'name' => 'DEV ALPHA',
'mail' => 'alpha@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -174,7 +178,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 2002,
'name' => 'DEV BETA',
'mail' => 'beta@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -204,7 +209,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 3001,
'name' => 'DEV ENABLED',
'mail' => 'enabled@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,
@@ -216,7 +222,8 @@ class AdminUserListStatsTest extends TestCase
'msnv' => 3002,
'name' => 'DEV DISABLED',
'mail' => 'disabled@example.com',
'pass' => bcrypt('password'),
'pass' => md5('password'),
'departments' => 1,
'role' => User::ROLE_MEMBER,
'status' => User::STATUS_ACTIVE,
'card' => 10,