fix 消息转发插件清理缓存按钮
This commit is contained in:
parent
0997691b23
commit
eaf0d17118
@ -37,6 +37,7 @@ class MessageForward(_PluginBase):
|
|||||||
_enabled = False
|
_enabled = False
|
||||||
_wechat = None
|
_wechat = None
|
||||||
_pattern = None
|
_pattern = None
|
||||||
|
_clean: bool = False
|
||||||
_pattern_token = {}
|
_pattern_token = {}
|
||||||
|
|
||||||
# 企业微信发送消息URL
|
# 企业微信发送消息URL
|
||||||
@ -47,9 +48,19 @@ class MessageForward(_PluginBase):
|
|||||||
def init_plugin(self, config: dict = None):
|
def init_plugin(self, config: dict = None):
|
||||||
if config:
|
if config:
|
||||||
self._enabled = config.get("enabled")
|
self._enabled = config.get("enabled")
|
||||||
|
self._clean = config.get("clear")
|
||||||
self._wechat = config.get("wechat")
|
self._wechat = config.get("wechat")
|
||||||
self._pattern = config.get("pattern")
|
self._pattern = config.get("pattern")
|
||||||
|
|
||||||
|
if self._clean:
|
||||||
|
# 清理已有缓存
|
||||||
|
self.del_data("wechat_token")
|
||||||
|
self.update_config({
|
||||||
|
"enabled": self._enabled,
|
||||||
|
"clean": False,
|
||||||
|
"wechat": self._wechat,
|
||||||
|
"pattern": self._pattern
|
||||||
|
})
|
||||||
# 获取token存库
|
# 获取token存库
|
||||||
if self._enabled and self._wechat:
|
if self._enabled and self._wechat:
|
||||||
self.__save_wechat_token()
|
self.__save_wechat_token()
|
||||||
@ -90,6 +101,22 @@ class MessageForward(_PluginBase):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'component': 'VCol',
|
||||||
|
'props': {
|
||||||
|
'cols': 12,
|
||||||
|
'md': 6
|
||||||
|
},
|
||||||
|
'content': [
|
||||||
|
{
|
||||||
|
'component': 'VSwitch',
|
||||||
|
'props': {
|
||||||
|
'model': 'clear',
|
||||||
|
'label': '清除缓存'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -141,6 +168,7 @@ class MessageForward(_PluginBase):
|
|||||||
}
|
}
|
||||||
], {
|
], {
|
||||||
"enabled": False,
|
"enabled": False,
|
||||||
|
"clear": False,
|
||||||
"wechat": "",
|
"wechat": "",
|
||||||
"pattern": ""
|
"pattern": ""
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user