diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..b7e8bccc --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +export PYTHON_PATH=/Library/Frameworks/Python.framework/Versions/2.7/bin/python diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 25bf17fc..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18 \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 00000000..343dc534 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 18.18.2 diff --git a/package.json b/package.json index 76097629..964c0171 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stapxs-qq-lite", - "version": "2.8.0", + "version": "2.8.2", "private": false, "author": "Stapx Steve [林槐]", "description": "一个兼容 OneBot 的非官方网页版 QQ 客户端,使用 Vue 重制的全新版本。", @@ -28,6 +28,7 @@ "js-file-downloader": "^1.1.24", "js-yaml-loader": "^1.2.2", "jsonpath": "^1.1.1", + "log4js": "^6.9.1", "pinyin": "^3.0.0-alpha.4", "prismjs": "^1.29.0", "raw-loader": "^4.0.2", diff --git a/src/assets/css/append/append_new.css b/src/assets/css/append/append_new.css index 1dec176b..9c02066b 100644 --- a/src/assets/css/append/append_new.css +++ b/src/assets/css/append/append_new.css @@ -652,20 +652,20 @@ } .script-view .list > header > span { margin: 10px -5px 0 -5px; - font-size: 0.8rem; + font-size: 0.75rem; } .script-view .list-body { margin: 0 -5px; } .script-view .list-body h2 { - font-size: 0.9rem; + font-size: 0.8rem; } .script-view .list-body span { - font-size: 0.8rem; + font-size: 0.75rem; } .script-view .list-body span svg { margin: 0; - font-size: 0.75rem; + font-size: 0.7rem; } .script-view .editor-main { box-shadow: -5px 0px 4px -5px var(--color-shader); diff --git a/src/assets/l10n/zh-CN.json b/src/assets/l10n/zh-CN.json index 3a7216b5..61c36dd2 100644 --- a/src/assets/l10n/zh-CN.json +++ b/src/assets/l10n/zh-CN.json @@ -327,12 +327,20 @@ "scripts_run_condition": "条件", "scripts_run_trigger": "触发", "scripts_run_message": "新消息", + "scripts_run_userFlush": "好友/群列表刷新", "option_dev_append": "进阶功能", "option_dev_scripts_tip": "显示脚本功能面板", "statue_enabled": "已启用", "statue_disabled": "已禁用", "scripts_run_title_err": "脚本标题已存在", "scripts_run_notice": "脚本方法将限制在当前页面内,你可以参考当前页面的源代码来了解可用的方法可用。", + "option_dev_config_type": "解析配置", + "option_dev_config_type_tip": "不同框架之间的化学反应我们将其称之为达利园效应", + "option_dev_config_type_none": "未连接", + "cq_code": "CQ 码", + "array_code": "Array 数组", + "chat_pic": "图片", + "log_con_backend": "使用后端连接模式", "menu_about": "关于", "menu_update": "检查更新…", diff --git a/src/assets/pathMap/Lagrange.OneBot.yaml b/src/assets/pathMap/Lagrange.OneBot.yaml index da3f0471..00cfe790 100644 --- a/src/assets/pathMap/Lagrange.OneBot.yaml +++ b/src/assets/pathMap/Lagrange.OneBot.yaml @@ -20,10 +20,10 @@ user_list: group_id: /group_id group_name: /group_name member_count: /member_count - admin_flag: $.admins[?(@ == '')] + admin_flag: null - class_id: /group_id - class_name: /group_name + class_id: $.group.group_id + class_name: $.group.group_name user_id: /user_id nickname: /nickname remark: /remark diff --git a/src/assets/pathMap/NapCat.Onebot.yaml b/src/assets/pathMap/NapCat.Onebot.yaml index c3aeca52..6c684595 100644 --- a/src/assets/pathMap/NapCat.Onebot.yaml +++ b/src/assets/pathMap/NapCat.Onebot.yaml @@ -15,10 +15,10 @@ login_info: # 群、好友列表 friend_list: name: get_friends_with_category - source: $.data[*] + source: $.data[*].buddyList[*] list: - class_id: /categoryId - class_name: /categroyName + class_id: null + class_name: null user_id: /user_id nickname: /nickname remark: /remark @@ -30,7 +30,16 @@ group_list: group_id: /group_id group_name: /group_name member_count: /member_count - admin_flag: $.admins[?(@ == '')] + admin_flag: null +# 好友分组 +friend_category: + name: get_friends_with_category + source: $.data[*] + list: + class_id: /categoryId + class_name: /categoryName + sort_id: /categorySortId + users: $.buddyList[*].user_id # 消息列表 message_list: name: get_group_msg_history diff --git a/src/background.ts b/src/background.ts index 999b6333..9f09c945 100644 --- a/src/background.ts +++ b/src/background.ts @@ -5,14 +5,17 @@ import Store from 'electron-store' import installExtension from 'electron-devtools-installer' import windowStateKeeper from 'electron-window-state' +import packageInfo from '../package.json' import { noticeList, regIpcListener } from './function/electron/ipc' -import { version } from '../package.json' import { Menu, session, app, protocol, BrowserWindow } from 'electron' import { createProtocol } from 'vue-cli-plugin-electron-builder/lib' import { touchBar } from './function/electron/touchbar' +import log4js from 'log4js' const isDevelopment = process.env.NODE_ENV !== 'production' const isPrimary = app.requestSingleInstanceLock() +const logger = log4js.getLogger('background') +export let logLevel = isDevelopment ? 'debug' : 'info' protocol.registerSchemesAsPrivileged([ { scheme: 'app', privileges: { secure: true, standard: true } } @@ -21,19 +24,25 @@ protocol.registerSchemesAsPrivileged([ export let win = undefined as BrowserWindow | undefined export let touchBarInstance = undefined as touchBar | undefined -/* eslint-disable no-console */ async function createWindow() { + if(new Store().get('opt_log_level')) { + logLevel = (String) (new Store().get('opt_log_level')) ?? 'info' + } + logger.level = logLevel + + /* eslint-disable no-console */ console.log('') console.log(' _____ _____ _____ _____ __ __ \n' + '| __|_ _| _ | _ | | | \n' + '|__ | | | | | __|- -| \n' + '|_____| |_| |__|__|__| |__|__| CopyRight © Stapx Steve') console.log('=======================================================') - console.log('Welcome to Stapxs QQ Lite, current version: ' + version) - console.log('The background language component will be initialized after the frontend is loaded.') + console.log('日志等级:', logLevel) + /* eslint-enable no-console */ + logger.info('欢迎使用 Stapxs QQ Lite, 当前版本: ' + packageInfo.version) - console.log('Platform:' + process.platform) - console.log('Start creating main window ……') + logger.info('启动平台架构:' + process.platform) + logger.info('正在创建窗体 ……') Menu.setApplicationMenu(null) // 创建窗口 const mainWindowState = windowStateKeeper({ @@ -89,7 +98,7 @@ async function createWindow() { win = new BrowserWindow(windowConfig) win.once('focus', () => {if(win)win.flashFrame(false)}) mainWindowState.manage(win) // 窗口状态管理器 - console.log('Create main window to complete.') + logger.info('创建窗体完成') // 注册 IPC 事务 regIpcListener() // macOS:创建 TouchBar @@ -175,8 +184,8 @@ app.on('ready', async () => { if (isDevelopment && !process.env.IS_TEST) { try { await installExtension('nhdogjmejiglipccpnnnanhbledajbpd') - } catch (e: any) { - console.error('Vue Devtools failed to install:', e.toString()) + } catch (e: unknown) { + logger.error('Vue Devtools 安装失败:', (e as Error).toString()) } } createWindow() diff --git a/src/components/MsgBody.vue b/src/components/MsgBody.vue index 332279c8..7dd26830 100644 --- a/src/components/MsgBody.vue +++ b/src/components/MsgBody.vue @@ -23,19 +23,13 @@ {{ isMe ? runtimeData.loginInfo.nickname : runtimeData.chatInfo.show.name }}
- -
- - {{ getRepInfo((data.source ? data.source.message : ''), data) }} -