Files
YwxAppThink/addon/haonav/view/frontend/index/apply.html
T
yangwx 18101cf11a feat: 上线前安全加固与发布工程化;appmall 由插件迁移为独立应用
安全(P0)
- 发布包签名:新增 scripts/package_keygen.php、scripts/package_verify.php、
  ywxapp\service\PackageVerifier;FrameworkService::apply() 解压前强制验签
  (ywxapp.framework_package_verify,默认开启)
- JWT 收紧:config/jwt.php 移除公开默认密钥,JwtService::assertStrongSecret()
  校验非空 / 长度≥32 / 已知弱值;.env.production.example 键名由 JWT_SECRET_KEY 修正为 JWT_SECRET
- /api/v1/Article:免登录白名单收窄为只读接口,写操作字段白名单 + assertOwner() 越权校验
- 开发者令牌:查找接口不再回显明文、统一失败文案 + 限流
- TemplateInstaller:文件名白名单 + realpath 归一化 + 目录内断言,修复 Zip Slip;补 use ZipArchive
- 后台登录:接入验证码、失败锁定与登录限流(config/ratelimit.php)
- 缓存 / Session 驱动可由 .env 覆盖(CACHE_DRIVER / SESSION_TYPE),集群部署改 redis
- paycenter 支付日志开关改为 PAY_LOG,不再跟随 APP_DEBUG

工程化 / 交付
- 新增 CHANGELOG.md 与 .env.production.example;composer.lock 入库锁定依赖版本
- 插件离线安装 CLI 增加 --uid,后台上传安装透传 uid,付费插件授权校验可通过
- 授权拒绝文案区分「未携带 uid」与「未找到有效授权」,便于排障
- .gitignore 放行 .env.production.example / .env.addon.example / .gitattributes / public/.htaccess

结构
- appmall 由 addon/appmall 迁移为独立应用 app/appmall(市场 / 开发者中心 / 审核 / 分润)
2026-10-22 00:53:39 +08:00

101 lines
4.6 KiB
HTML

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>申请收录 / 广告合作 - 网址导航</title>
{include file="public/styles" /}
<link rel="stylesheet" href="/static/haonav/css/nav-page-apply.css">
</head>
<body>
{assign name="navActive" value="apply" /}
{assign name="navSearch" value="engine" /}
{assign name="navUser" value="1" /}
{include file="public/navbar" /}
<div class="main-content">
<div class="submit-box">
<h2>🤝 申请收录 / 广告合作</h2>
<div class="apply-tabs">
<button type="button" class="active" data-type="1">友链 / 收录申请</button>
<button type="button" data-type="2">广告合作</button>
</div>
<form id="applyForm">
<input type="hidden" name="type" value="1">
<!-- 蜜罐字段:请勿填写 -->
<div class="hp-field" aria-hidden="true">
<input type="text" name="website" tabindex="-1" autocomplete="off">
</div>
<div class="form-row">
<label>网站 / 品牌名称 *</label>
<input type="text" name="title" required maxlength="100" placeholder="例如:某某工具站">
</div>
<div class="form-row">
<label>网址 *</label>
<input type="url" name="url" required placeholder="https://...">
</div>
<div class="form-row" id="slotRow" style="display:none;">
<label>意向广告位</label>
<select name="slot">
<option value="">不确定 / 由站长推荐</option>
{foreach $slots as $sk=>$sv}<option value="{$sk}">{$sv}</option>{/foreach}
</select>
</div>
<div class="form-row">
<label>说明</label>
<textarea name="description" maxlength="500" placeholder="友链:一句话介绍您的网站;广告:投放需求、预算与周期等"></textarea>
</div>
<div class="form-row">
<label>联系方式 *</label>
<input type="text" name="contact" required maxlength="100" placeholder="邮箱 / QQ / 微信,审核结果将通过它联系您">
</div>
<button type="submit" class="btn-primary">提交申请</button>
<div class="form-msg" id="applyMsg"></div>
</form>
</div>
</div>
<div class="footer">
<p>© 2026 网址导航 - 让上网更简单</p>
</div>
<script src="/static/haonav/js/nav-core.js"></script>
<script src="/static/haonav/js/nav-theme.js"></script>
<script src="/static/haonav/js/nav-festival.js"></script>
<script src="/static/haonav/js/nav-search.js"></script>
<script src="/static/haonav/js/auth.js"></script>
<script>
(function () {
var form = document.getElementById('applyForm');
var msg = document.getElementById('applyMsg');
var typeInput = form.querySelector('input[name="type"]');
var slotRow = document.getElementById('slotRow');
document.querySelectorAll('.apply-tabs button').forEach(function (btn) {
btn.addEventListener('click', function () {
document.querySelectorAll('.apply-tabs button').forEach(function (b) { b.classList.remove('active'); });
btn.classList.add('active');
typeInput.value = btn.dataset.type;
slotRow.style.display = btn.dataset.type === '2' ? '' : 'none';
});
});
form.addEventListener('submit', function (e) {
e.preventDefault();
var fd = new FormData(form);
msg.textContent = '提交中...';
fetch('/haonav/apply.html', {
method: 'POST',
headers: { 'X-Requested-With': 'XMLHttpRequest' },
body: fd
}).then(function (r) { return r.json(); }).then(function (res) {
msg.textContent = res.message || res.msg || '';
if (res.code === 0) { form.reset(); typeInput.value = document.querySelector('.apply-tabs button.active').dataset.type; }
}).catch(function () { msg.textContent = '网络异常,请稍后再试'; });
});
})();
</script>
</body>
</html>