feat: Implement core course management, enrollment, and classroom learning functionalities with new composables and components.
This commit is contained in:
parent
05755992a7
commit
754f211a08
4 changed files with 221 additions and 66 deletions
|
|
@ -451,6 +451,12 @@ export const useAuth = () => {
|
|||
token.value = null
|
||||
refreshToken.value = null // ลบ Refresh Token
|
||||
user.value = null
|
||||
|
||||
// Reset client-side storage
|
||||
if (import.meta.client) {
|
||||
localStorage.clear()
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
router.push('/auth/login')
|
||||
}
|
||||
|
|
|
|||
|
|
@ -419,14 +419,7 @@ export const useCourse = () => {
|
|||
const data = await $fetch<{ code: number; message: string; data: any }>(`${API_BASE_URL}/students/lessons/${lessonId}/progress`, {
|
||||
method: 'POST',
|
||||
headers: token.value ? {
|
||||
// User Request: "Backend รับ header แบบ Authorization: <token> (ยังไม่ใช้ Bearer)"
|
||||
// Checking existing usage, most use Bearer. I will stick to existing Bearer for consistency unless it fails,
|
||||
// BUT user explicitly said "not using Bearer" in this specific prompt.
|
||||
// To be safe and minimal, I will keep using `Bearer ${token}` if that's what the codebase uses globally,
|
||||
// UNLESS I see strong evidence otherwise.
|
||||
// The user's curl example in Step 209 DOES NOT have "Bearer".
|
||||
// So I will remove it for these 2 functions as requested.
|
||||
Authorization: `${token.value}`
|
||||
Authorization: `Bearer ${token.value}`
|
||||
} : {},
|
||||
body: {
|
||||
video_progress_seconds: progressSeconds,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue