重构: 将油猴脚本调整为通用版本

主要改动:
1. 移除微信公众号相关配置和检测规则
2. 将 @match 改为通配符 *://*/* 支持所有网站
3. 添加注释说明如何添加自定义网站检测规则
4. 保留通义听悟作为示例
5. 强调通用性,用户可自行扩展

脚本现在是真正的通用数据同步工具,不局限于特定网站。
This commit is contained in:
2026-08-14 10:20:39 +08:00
parent a3c23970d7
commit e985a1a143
2 changed files with 23 additions and 17 deletions
+10 -7
View File
@@ -4,8 +4,7 @@
// @version 2.0.0
// @description 一键同步 Cookie/Token 到服务器(通用版),支持可视化配置管理
// @author K-hermes
// @match https://tingwu.aliyun.com/*
// @match https://mp.weixin.qq.com/*
// @match *://*/*
// @grant GM_xmlhttpRequest
// @grant GM_setClipboard
// @grant GM_setValue
@@ -47,17 +46,21 @@
let CONFIG = loadConfig();
// ==================== 项目检测 ====================
// 用户可以根据需要添加自己的检测规则
const PROJECT_PATTERNS = {
// 示例:通义听悟
'tingwu.aliyun.com': {
project: 'tingwu',
accountSelector: '.user-email, [class*="email"], [class*="account"]',
loginUrl: 'https://tingwu.aliyun.com/'
},
'mp.weixin.qq.com': {
project: 'wechat',
accountSelector: '.account__nickname, .weui-desktop-account__name',
loginUrl: 'https://mp.weixin.qq.com/'
}
// 可以在这里添加更多网站的检测规则
// 示例格式:
// 'example.com': {
// project: '网站名称',
// accountSelector: '.username, .account',
// loginUrl: 'https://example.com/'
// }
};
function detectProject() {