⬆️ Upgrade(custom): upgrade s3 package

This commit is contained in:
Kuingsmile
2026-01-04 17:49:15 +08:00
parent f506daaa71
commit 4d074e8ed2
5 changed files with 55 additions and 61 deletions

View File

@@ -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 {