mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-23 23:06:06 +08:00
添加Cookie增加每条验证
1. codemirror主题改为默认 2. docker打包触发条件改为tag
This commit is contained in:
parent
3f2f165d72
commit
64a8acde92
5
.github/workflows/docker.yml
vendored
5
.github/workflows/docker.yml
vendored
|
@ -1,5 +1,8 @@
|
|||
name: Publish Docker Image
|
||||
on: [push]
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
|
@ -5,7 +5,6 @@ body {
|
|||
}
|
||||
|
||||
@import '~codemirror/lib/codemirror.css';
|
||||
@import '~codemirror/theme/icecoder.css';
|
||||
|
||||
.code-mirror-wrapper .CodeMirror {
|
||||
position: absolute;
|
||||
|
|
|
@ -67,6 +67,7 @@ export default function (props: any) {
|
|||
{
|
||||
icon: <LogoutOutlined />,
|
||||
name: '退出登录',
|
||||
path: 'logout',
|
||||
onTitleClick: () => logout(),
|
||||
},
|
||||
];
|
||||
|
|
|
@ -63,7 +63,6 @@ const Crontab = () => {
|
|||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
mode: 'shell',
|
||||
theme: 'icecoder',
|
||||
readOnly: true,
|
||||
}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
|
|
|
@ -81,7 +81,6 @@ const Config = () => {
|
|||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
mode: 'shell',
|
||||
theme: 'icecoder',
|
||||
}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
setValue(value);
|
||||
|
|
|
@ -15,10 +15,24 @@ const CookieModal = ({
|
|||
const [form] = Form.useForm();
|
||||
|
||||
const handleOk = async (values: any) => {
|
||||
const cookies = values.cookie
|
||||
.split('\n')
|
||||
.map((x: any) => x.trim().replace(/\s/g, ''));
|
||||
let flag = false;
|
||||
for (const coo of cookies) {
|
||||
if (!/pt_key=\S*;\s*pt_pin=\S*;\s*/.test(coo)) {
|
||||
notification.error({ message: `${coo}格式有误` });
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
return;
|
||||
}
|
||||
const method = cookie ? 'put' : 'post';
|
||||
const payload = cookie
|
||||
? { cookie: values.cookie, oldCookie: cookie }
|
||||
: { cookies: values.cookie.split('\n') };
|
||||
? { cookie: cookies[0], oldCookie: cookie }
|
||||
: { cookies };
|
||||
const { code, data } = await request[method](`${config.apiPrefix}cookie`, {
|
||||
data: payload,
|
||||
});
|
||||
|
@ -62,13 +76,14 @@ const CookieModal = ({
|
|||
rules={[
|
||||
{ required: true, message: '请输入Cookie' },
|
||||
{
|
||||
pattern: /[pt_pin=|pt_key=](.+?);[pt_pin=|pt_key=](.+?);/,
|
||||
pattern: /pt_key=\S*;\s*pt_pin=\S*;\s*/,
|
||||
message: 'Cookie格式错误,注意分号(pt_key=***;pt_pin=***;)',
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.TextArea
|
||||
rows={4}
|
||||
autoSize={true}
|
||||
placeholder="请输入cookie,多个cookie换行输入"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
|
|
@ -80,7 +80,6 @@ const Crontab = () => {
|
|||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
mode: 'shell',
|
||||
theme: 'icecoder',
|
||||
}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
setValue(value);
|
||||
|
|
|
@ -80,7 +80,6 @@ const Crontab = () => {
|
|||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
mode: 'shell',
|
||||
theme: 'icecoder',
|
||||
}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
setValue(value);
|
||||
|
|
|
@ -108,7 +108,6 @@ const Log = () => {
|
|||
styleActiveLine: true,
|
||||
matchBrackets: true,
|
||||
mode: 'shell',
|
||||
theme: 'icecoder',
|
||||
readOnly: true,
|
||||
}}
|
||||
onBeforeChange={(editor, data, value) => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user