forked from Gitlink/forgeplus-react
pr校验
This commit is contained in:
parent
4c711be24d
commit
297a7fdf2d
|
@ -135,9 +135,14 @@ function StudentSubmit(props){
|
||||||
return isLt100M;
|
return isLt100M;
|
||||||
}
|
}
|
||||||
function checkPrLink(rule, value, callback) {
|
function checkPrLink(rule, value, callback) {
|
||||||
|
const getUrl = `${
|
||||||
|
window.location.href.indexOf("gitlink.org.cn") > -1
|
||||||
|
? "https://www.gitlink.org.cn"
|
||||||
|
: "https://testforgeplus.trustie.net"
|
||||||
|
}`;
|
||||||
if (value) {
|
if (value) {
|
||||||
axios
|
axios
|
||||||
.get(`https://www.gitlink.org.cn/check_pr_url`, {
|
.get(`${getUrl}/check_pr_url`, {
|
||||||
params: {
|
params: {
|
||||||
url: value,
|
url: value,
|
||||||
task: checkedTaskId,
|
task: checkedTaskId,
|
||||||
|
@ -163,10 +168,10 @@ function StudentSubmit(props){
|
||||||
}
|
}
|
||||||
callback();
|
callback();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
callback("请正确输入视频链接");
|
callback("请正确输入pr地址");
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
callback("请输入视频链接");
|
callback("请输入pr地址");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return <div className="interimBox">
|
return <div className="interimBox">
|
||||||
|
|
Loading…
Reference in New Issue