Jelajahi Sumber

style: format code

nian 2 bulan lalu
induk
melakukan
32aa8eb596

+ 5 - 4
src/layout/header/Actions/component/SignOut.vue

@@ -9,23 +9,24 @@ const userStore = useUserStore()
 const dialog = useDialog()
 
 const { getModalModifier } = useComponentModifier()
-const onSignout = () => {
+
+const handleSignOutClick = () => {
   dialog.info({
     ...getModalModifier(),
     title: '退出登录',
     content: '确定要退出登录吗?',
     positiveText: '确定',
     negativeText: '取消',
-    onPositiveClick: onConfirm,
+    onPositiveClick: clearUserInfo,
   })
 }
 
-const onConfirm = () => {
+function clearUserInfo() {
   userStore.cleanup()
 }
 </script>
 <template>
-  <ButtonAnimation @click="onSignout">
+  <ButtonAnimation @click="handleSignOutClick">
     <span class="iconify size-5 ph--sign-out" />
   </ButtonAnimation>
 </template>

+ 1 - 0
src/router/guard.ts

@@ -58,6 +58,7 @@ export function setupRouterGuard(router: Router) {
     }
 
     next()
+    return false
   })
 
   router.beforeResolve((_, __, next) => {

+ 2 - 0
src/stores/configure.ts

@@ -71,6 +71,8 @@ export const useConfigureStore = defineStore('configureStore', () => {
         return srcValue
       }
     })
+
+    return null
   }
 
   const reset = () => {

+ 1 - 1
src/utils/tailwindColor.test.ts

@@ -40,7 +40,7 @@ function generateTailwindColor() {
     if (!hexCache.has(value)) {
       hexCache.set(value, chroma(value).hex())
     }
-    return hexCache.get(value)!
+    return hexCache.get(value) || ''
   }
 
   const mixHex = (a: string, b: string, ratio = 0.5): string => chroma.mix(a, b, ratio).hex()

+ 1 - 2
src/views/data-show/data-table/ModalData.vue

@@ -17,8 +17,7 @@ const { selectInPopover, datePickerInPopover } = useComponentThemeOverrides()
 const formRef = useTemplateRef<InstanceType<typeof NForm>>('formRef')
 
 const emits = defineEmits<{
-  (e: 'submit', value: Partial<UserInfo>): void
-  (e: 'update', value: Partial<UserInfo>): void
+  (e: 'submit' | 'update', value: Partial<UserInfo>): void
   (e: 'cancel'): void
 }>()