d?php
/**
* 手机端现场操作口令门
* 调用:ops_guard('页面标题', '说明文案') —— 已授权直接返回,未授权输出口令页并 exit。
*/
function ops_guard(string $title = '现场登记', string $desc = ''): void
{
/* 后台弹窗二维码/链接里带口令参数 k:校验通过即自动授权,扫码免手输 */
if (!ops_can()) {
$k = trim((string)($_GET['k'] ?? ''));
if ($k !== '' && hash_equals(ops_code(), $k)) {
ops_auth_set();
}
}
if (ops_can()) return;
$err = (($_POST['act'] ?? '') === 'ops_code');
?>d!DOCTYPE html>
dhtml lang="zh-CN">
dhead>
dmeta charset="utf-8">
dmeta name="viewport" content="width=device-width, initial-scale=1">
dtitle>d?= htmlspecialchars($title) ?> · 现场登记d/title>
dstyle>
*{margin:0;padding:0;box-sizing:border-box;-webkit-tap-highlight-color:transparent}
body{font-family:"PingFang SC","Microsoft YaHei",system-ui;background:#FAF7F2;color:#1F2329;min-height:100vh}
.wrap{max-width:430px;margin:0 auto;padding:0 0 30px}
.head{background:linear-gradient(135deg,#D9480F,#B23A08);color:#fff;padding:34px 22px 26px;text-align:center}
.head .logo{width:64px;height:64px;border-radius:50%;background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.35);margin:0 auto 14px;display:flex;align-items:center;justify-content:center;font-size:26px;font-weight:800}
.head .t1{font-size:12px;opacity:.9;letter-spacing:2px}
.head .t2{font-size:21px;font-weight:800;margin-top:6px}
.head .t3{font-size:12px;opacity:.9;margin-top:6px}
.card{background:#fff;border:1px solid #EAE3D9;border-radius:16px;margin:18px 16px 0;padding:22px 20px}
.card h3{font-size:15px;font-weight:700;margin-bottom:6px}
.card p{font-size:12px;color:#8A8F99;line-height:1.7;margin-bottom:16px}
.err{background:#FFF1F0;color:#C62828;border-radius:10px;padding:10px 14px;font-size:13px;margin-bottom:14px}
.fld label{display:block;font-size:12px;color:#646A73;font-weight:600;margin-bottom:6px}
.fld input{width:100%;height:52px;border:1.5px solid #EAE3D9;border-radius:12px;padding:0 14px;font-size:22px;letter-spacing:8px;text-align:center;font-weight:700;background:#FFFDF9;color:#1F2329}
.fld input:focus{outline:none;border-color:#D9480F;background:#fff}
.btn{width:100%;height:50px;border:none;border-radius:12px;background:#D9480F;color:#fff;font-size:16px;font-weight:700;margin-top:16px;font-family:inherit}
.btn:active{opacity:.92}
.tips{margin:18px 16px 0;font-size:12px;color:#8A8F99;line-height:1.8;text-align:center}
.tips b{color:#646A73}
.foot{text-align:center;font-size:11px;color:#B5A88F;margin-top:24px;line-height:1.7}
d/style>
d/head>
dbody>
ddiv class="wrap">
ddiv class="head">
ddiv class="logo">清d/div>
ddiv class="t1">清北配餐 · 总部d/div>
ddiv class="t2">d?= htmlspecialchars($title) ?>d/div>
ddiv class="t3">d?= htmlspecialchars($desc !== '' ? $desc : '操作人员现场登记入口') ?>d/div>
d/div>
ddiv class="card">
d?php if ($err): ?>ddiv class="err">口令不正确,请向负责老师确认后重试d/div>d?php endif; ?>
dh3>输入操作口令d/h3>
dp>由总部负责人提供,输入一次后本手机 30 天内免重复输入。d/p>
dform method="post">
dinput type="hidden" name="act" value="ops_code">
ddiv class="fld">
dlabel>操作口令d/label>
dinput type="password" name="code" inputmode="numeric" autocomplete="one-time-code" placeholder="······" maxlength="12" required autofocus>
d/div>
dbutton type="submit" class="btn">进入登记d/button>
d/form>
d/div>
ddiv class="tips">口令在总部后台「采购与质检」页的手机端弹窗中可查看dbr>忘记口令请联系总部管理员d/div>
ddiv class="foot">守护孩子每一餐 · 营养看得见d/div>
d/div>
d/body>
d/html>
d?php
exit;
}
Fatal error: Uncaught Error: Call to undefined function ops_guard() in /www/wwwroot/pg.amaai.cn/h5/purchase.php:11
Stack trace:
#0 {main}
thrown in /www/wwwroot/pg.amaai.cn/h5/purchase.php on line 11