v1.7.1: 멤버 권한·추천 사이트·네비게이션 UI 개선
관리자는 VIP·멤버만 수정 가능하도록 서버·UI 권한을 정리하고 소유자 권한 이전 API와 확인 모달을 추가했다. 추천 사이트 파비콘 캐시·URL 접두사·카드 편집 UI를 보강하고 확인 얼럿을 AdminConfirmModal로 통일했다. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -2,6 +2,12 @@ import { onUnmounted, ref } from 'vue'
|
||||
|
||||
const TOAST_AUTO_HIDE_MS = 4000
|
||||
|
||||
/**
|
||||
* 브라우저 타이머 API를 안전하게 사용한다.
|
||||
* @returns {typeof window | null} window 객체
|
||||
*/
|
||||
const getBrowserWindow = () => (typeof window !== 'undefined' ? window : null)
|
||||
|
||||
/**
|
||||
* 관리자 화면 우측 상단 피드백 토스트. 모달(z-50 등)보다 위에 보이도록 사용처에서 `z-[100]` 클래스를 둔다.
|
||||
* @returns {{ toast: import('vue').Ref<null | { type: string, message: string }>, showToast: (type: string, message: string) => void, clearToast: () => void }}
|
||||
@@ -15,7 +21,10 @@ export const useAdminToast = () => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const clearToast = () => {
|
||||
window.clearTimeout(toastTimer)
|
||||
const browserWindow = getBrowserWindow()
|
||||
if (browserWindow) {
|
||||
browserWindow.clearTimeout(toastTimer)
|
||||
}
|
||||
toastTimer = null
|
||||
toast.value = null
|
||||
}
|
||||
@@ -27,20 +36,28 @@ export const useAdminToast = () => {
|
||||
* @returns {void}
|
||||
*/
|
||||
const showToast = (type, message) => {
|
||||
window.clearTimeout(toastTimer)
|
||||
const browserWindow = getBrowserWindow()
|
||||
if (browserWindow) {
|
||||
browserWindow.clearTimeout(toastTimer)
|
||||
}
|
||||
const text = String(message || '').trim() || '알림'
|
||||
toast.value = {
|
||||
type,
|
||||
message: text
|
||||
}
|
||||
toastTimer = window.setTimeout(() => {
|
||||
toast.value = null
|
||||
toastTimer = null
|
||||
}, TOAST_AUTO_HIDE_MS)
|
||||
if (browserWindow) {
|
||||
toastTimer = browserWindow.setTimeout(() => {
|
||||
toast.value = null
|
||||
toastTimer = null
|
||||
}, TOAST_AUTO_HIDE_MS)
|
||||
}
|
||||
}
|
||||
|
||||
onUnmounted(() => {
|
||||
window.clearTimeout(toastTimer)
|
||||
const browserWindow = getBrowserWindow()
|
||||
if (browserWindow) {
|
||||
browserWindow.clearTimeout(toastTimer)
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user