mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-25 00:16: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
|
name: Publish Docker Image
|
||||||
on: [push]
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
|
@ -5,7 +5,6 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
@import '~codemirror/lib/codemirror.css';
|
@import '~codemirror/lib/codemirror.css';
|
||||||
@import '~codemirror/theme/icecoder.css';
|
|
||||||
|
|
||||||
.code-mirror-wrapper .CodeMirror {
|
.code-mirror-wrapper .CodeMirror {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
@ -67,6 +67,7 @@ export default function (props: any) {
|
||||||
{
|
{
|
||||||
icon: <LogoutOutlined />,
|
icon: <LogoutOutlined />,
|
||||||
name: '退出登录',
|
name: '退出登录',
|
||||||
|
path: 'logout',
|
||||||
onTitleClick: () => logout(),
|
onTitleClick: () => logout(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -63,7 +63,6 @@ const Crontab = () => {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
theme: 'icecoder',
|
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
}}
|
}}
|
||||||
onBeforeChange={(editor, data, value) => {
|
onBeforeChange={(editor, data, value) => {
|
||||||
|
|
|
@ -81,7 +81,6 @@ const Config = () => {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
theme: 'icecoder',
|
|
||||||
}}
|
}}
|
||||||
onBeforeChange={(editor, data, value) => {
|
onBeforeChange={(editor, data, value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
|
|
|
@ -15,10 +15,24 @@ const CookieModal = ({
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
const handleOk = async (values: any) => {
|
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 method = cookie ? 'put' : 'post';
|
||||||
const payload = cookie
|
const payload = cookie
|
||||||
? { cookie: values.cookie, oldCookie: cookie }
|
? { cookie: cookies[0], oldCookie: cookie }
|
||||||
: { cookies: values.cookie.split('\n') };
|
: { cookies };
|
||||||
const { code, data } = await request[method](`${config.apiPrefix}cookie`, {
|
const { code, data } = await request[method](`${config.apiPrefix}cookie`, {
|
||||||
data: payload,
|
data: payload,
|
||||||
});
|
});
|
||||||
|
@ -62,13 +76,14 @@ const CookieModal = ({
|
||||||
rules={[
|
rules={[
|
||||||
{ required: true, message: '请输入Cookie' },
|
{ 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=***;)',
|
message: 'Cookie格式错误,注意分号(pt_key=***;pt_pin=***;)',
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input.TextArea
|
<Input.TextArea
|
||||||
rows={4}
|
rows={4}
|
||||||
|
autoSize={true}
|
||||||
placeholder="请输入cookie,多个cookie换行输入"
|
placeholder="请输入cookie,多个cookie换行输入"
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|
|
@ -80,7 +80,6 @@ const Crontab = () => {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
theme: 'icecoder',
|
|
||||||
}}
|
}}
|
||||||
onBeforeChange={(editor, data, value) => {
|
onBeforeChange={(editor, data, value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
|
|
|
@ -80,7 +80,6 @@ const Crontab = () => {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
theme: 'icecoder',
|
|
||||||
}}
|
}}
|
||||||
onBeforeChange={(editor, data, value) => {
|
onBeforeChange={(editor, data, value) => {
|
||||||
setValue(value);
|
setValue(value);
|
||||||
|
|
|
@ -108,7 +108,6 @@ const Log = () => {
|
||||||
styleActiveLine: true,
|
styleActiveLine: true,
|
||||||
matchBrackets: true,
|
matchBrackets: true,
|
||||||
mode: 'shell',
|
mode: 'shell',
|
||||||
theme: 'icecoder',
|
|
||||||
readOnly: true,
|
readOnly: true,
|
||||||
}}
|
}}
|
||||||
onBeforeChange={(editor, data, value) => {
|
onBeforeChange={(editor, data, value) => {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user