修改检查是否是司令的接口

This commit is contained in:
cebgcontract 2022-10-24 19:26:25 +08:00
parent 1d5d2bcb3f
commit 6526b9be65

View File

@ -65,6 +65,7 @@
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.min.js" integrity="sha256-JwUksNJ6/R07ZiLRoXbGeNrtlFZMFDKX4hemPiHOmCA=" crossorigin="anonymous"></script>
<script>
const FORM_URL = 'http://192.168.100.82:3000/invitation/add_commander';
const CHECK_URL = 'http://192.168.100.82:3000/invitation/check_is_commander';
$().ready(function() {
function getUrlParam(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
@ -146,7 +147,7 @@
headers.append("Content-Type", "application/json");
try {
let data = await fetch(
FORM_URL,
CHECK_URL,
{
method: 'POST',
headers,
@ -159,7 +160,7 @@
return res.json()
})
if (!data.errcode) {
return true
return data.result === 1
} else {
return false
}