mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
⬆️ Upgrade(custom): upgrade s3 package
This commit is contained in:
@@ -10,13 +10,12 @@ import type { IConfig } from 'piclist'
|
||||
import { onBeforeMount, onMounted } from 'vue'
|
||||
|
||||
import UIServiceProvider from '@/components/ui/UIServiceProvider.vue'
|
||||
import { useAppStore } from '@/hooks/useAppStore'
|
||||
import { useATagClick } from '@/hooks/useATagClick'
|
||||
import { useStore } from '@/hooks/useStore'
|
||||
import { getConfig } from '@/utils/dataSender'
|
||||
import { pageReloadCount } from '@/utils/global'
|
||||
|
||||
import { useAppStore } from './hooks/useAppStore'
|
||||
|
||||
useATagClick()
|
||||
|
||||
const store = useStore()
|
||||
@@ -40,7 +39,7 @@ onMounted(async () => {
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
name: 'PicGoApp',
|
||||
name: 'PicList',
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ const showConfirm = (options: ConfirmOptions): Promise<boolean> => {
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
// Initialize message service
|
||||
const { setMessageService } = useMessage()
|
||||
if (messageRef.value) {
|
||||
setMessageService({
|
||||
|
||||
@@ -11,41 +11,37 @@ interface MessageService {
|
||||
|
||||
const messageServiceRef = ref<MessageService | null>(null)
|
||||
|
||||
const msgHelper = (
|
||||
message: string,
|
||||
type: 'success' | 'error' | 'warning' | 'info',
|
||||
options?: Partial<MessageOptions>,
|
||||
) => {
|
||||
if (messageServiceRef.value) {
|
||||
return messageServiceRef.value[type](message, options)
|
||||
}
|
||||
console.warn('Message service not initialized')
|
||||
return ''
|
||||
}
|
||||
|
||||
export function useMessage() {
|
||||
const setMessageService = (service: MessageService) => {
|
||||
messageServiceRef.value = service
|
||||
}
|
||||
|
||||
const success = (message: string, options?: Partial<MessageOptions>) => {
|
||||
if (messageServiceRef.value) {
|
||||
return messageServiceRef.value.success(message, options)
|
||||
}
|
||||
console.warn('Message service not initialized')
|
||||
return ''
|
||||
return msgHelper(message, 'success', options)
|
||||
}
|
||||
|
||||
const error = (message: string, options?: Partial<MessageOptions>) => {
|
||||
if (messageServiceRef.value) {
|
||||
return messageServiceRef.value.error(message, options)
|
||||
}
|
||||
console.warn('Message service not initialized')
|
||||
return ''
|
||||
return msgHelper(message, 'error', options)
|
||||
}
|
||||
|
||||
const warning = (message: string, options?: Partial<MessageOptions>) => {
|
||||
if (messageServiceRef.value) {
|
||||
return messageServiceRef.value.warning(message, options)
|
||||
}
|
||||
console.warn('Message service not initialized')
|
||||
return ''
|
||||
return msgHelper(message, 'warning', options)
|
||||
}
|
||||
|
||||
const info = (message: string, options?: Partial<MessageOptions>) => {
|
||||
if (messageServiceRef.value) {
|
||||
return messageServiceRef.value.info(message, options)
|
||||
}
|
||||
console.warn('Message service not initialized')
|
||||
return ''
|
||||
return msgHelper(message, 'info', options)
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user