mirror of
				https://gitee.com/dromara/mayfly-go
				synced 2025-11-04 08:20:25 +08:00 
			
		
		
		
	refactor: dbm
This commit is contained in:
		@@ -1,9 +1,9 @@
 | 
			
		||||
import Config from './config';
 | 
			
		||||
import {ElNotification} from 'element-plus';
 | 
			
		||||
import SocketBuilder from './SocketBuilder';
 | 
			
		||||
import {getToken} from '@/common/utils/storage';
 | 
			
		||||
import { getToken } from '@/common/utils/storage';
 | 
			
		||||
 | 
			
		||||
import {joinClientParams} from './request';
 | 
			
		||||
import { joinClientParams } from './request';
 | 
			
		||||
import { ElNotification } from 'element-plus';
 | 
			
		||||
 | 
			
		||||
class SysSocket {
 | 
			
		||||
    /**
 | 
			
		||||
@@ -23,7 +23,6 @@ class SysSocket {
 | 
			
		||||
        0: 'error',
 | 
			
		||||
        1: 'success',
 | 
			
		||||
        2: 'info',
 | 
			
		||||
        22: 'info',
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -57,21 +56,16 @@ class SysSocket {
 | 
			
		||||
                    return;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // 默认通知处理
 | 
			
		||||
                const type = this.getMsgType(message.type);
 | 
			
		||||
                let msg = message.msg
 | 
			
		||||
                let duration = 0
 | 
			
		||||
                if (message.type == 22) {
 | 
			
		||||
                    let obj = JSON.parse(msg);
 | 
			
		||||
                    msg = `文件:${obj['title']} 执行成功: ${obj['executedStatements']} 条`
 | 
			
		||||
                    duration = 2000
 | 
			
		||||
                }
 | 
			
		||||
                let msg = message.msg;
 | 
			
		||||
                let duration = 0;
 | 
			
		||||
                ElNotification({
 | 
			
		||||
                    duration: duration,
 | 
			
		||||
                    title: message.title,
 | 
			
		||||
                    message: msg,
 | 
			
		||||
                    type: type,
 | 
			
		||||
                });
 | 
			
		||||
                console.log(message)
 | 
			
		||||
            })
 | 
			
		||||
            .open((event: any) => console.log(event))
 | 
			
		||||
            .close(() => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user