Update: cache module, security modules and build
This commit is contained in:
@@ -41,6 +41,9 @@
|
||||
.status-item { background: white; padding: 20px 30px; border-radius: 10px; text-align: center; }
|
||||
.status-item .value { font-size: 2em; font-weight: bold; color: #667eea; }
|
||||
.status-item .label { color: #666; margin-top: 5px; }
|
||||
.lab { background:#fff7e6; border:1px solid #ffe58f; border-radius:10px; padding:16px; margin-bottom:20px; }
|
||||
.lab h4 { margin-bottom:8px; color:#ad6800; }
|
||||
.lab ul { margin-left:18px; color:#444; line-height:1.7; }
|
||||
|
||||
footer { text-align: center; padding: 30px; color: #666; margin-top: 40px; }
|
||||
</style>
|
||||
@@ -69,6 +72,22 @@
|
||||
<div class="value" id="orderCount">-</div>
|
||||
<div class="label">订单数量</div>
|
||||
</div>
|
||||
<div class="status-item">
|
||||
<div class="value" id="activeProfile">-</div>
|
||||
<div class="label">当前 Profile</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="lab">
|
||||
<h4>🧪 实验任务卡(事务模块)</h4>
|
||||
<p style="margin-bottom:8px;color:#8c8c8c;">鉴权学习建议:learn=none(先学核心),advanced=jwt/satoken(再学安全链路)</p>
|
||||
<ul>
|
||||
<li>目标:理解事务回滚与 REQUIRES_NEW 差异</li>
|
||||
<li>步骤1:到 transaction.html 创建普通订单(rollback=false)</li>
|
||||
<li>步骤2:再创建模拟失败订单(rollback=true)</li>
|
||||
<li>预期:主事务回滚,但独立事务可保留日志/部分数据(取决于实现)</li>
|
||||
<li>观察点:查看控制台事务日志(TransactionInterceptor TRACE)</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="nav">
|
||||
@@ -78,6 +97,10 @@
|
||||
<a href="mybatis.html">💾 MyBatis</a>
|
||||
<a href="transaction.html">🔄 事务管理</a>
|
||||
<a href="users.html">👥 用户管理</a>
|
||||
<a href="advanced.html">🚀 高级功能</a>
|
||||
<a href="reflection.html">🪞 反射实验室</a>
|
||||
<a href="auth-lab.html">🔐 鉴权实验室</a>
|
||||
<a href="verify-lab.html">🩺 修复验证实验室</a>
|
||||
<a href="api.html">🔌 API 测试</a>
|
||||
</div>
|
||||
|
||||
@@ -142,6 +165,55 @@
|
||||
<a href="users.html" class="btn">开始学习 →</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🚀 高级功能</h3>
|
||||
<p>Redis 缓存、分布式锁、多数据库、认证方案对比,从小白到高手的进阶之路。</p>
|
||||
<ul class="feature-list">
|
||||
<li><span class="icon">✅</span>Redis 数据类型操作</li>
|
||||
<li><span class="icon">✅</span>缓存穿透/击穿/雪崩</li>
|
||||
<li><span class="icon">✅</span>分布式锁实现</li>
|
||||
<li><span class="icon">✅</span>JWT vs Sa-Token</li>
|
||||
<li><span class="icon">✅</span>多数据库切换</li>
|
||||
</ul>
|
||||
<a href="advanced.html" class="btn">进阶学习 →</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🪞 反射实验室</h3>
|
||||
<p>动态查看类结构、通过构造器创建对象、修改私有字段、调用私有方法,理解 Spring 等框架底层为什么依赖反射。</p>
|
||||
<ul class="feature-list">
|
||||
<li><span class="icon">✅</span>类/字段/方法元信息</li>
|
||||
<li><span class="icon">✅</span>反射构造对象</li>
|
||||
<li><span class="icon">✅</span>私有字段修改</li>
|
||||
<li><span class="icon">✅</span>公开/私有/静态方法调用</li>
|
||||
</ul>
|
||||
<a href="reflection.html" class="btn">开始实验 →</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🔐 鉴权实验室</h3>
|
||||
<p>一步步体验登录、带 Token 请求、鉴权放行/拦截,对比 learn / advanced 模式差异。</p>
|
||||
<ul class="feature-list">
|
||||
<li><span class="icon">✅</span>登录拿 Token</li>
|
||||
<li><span class="icon">✅</span>自动携带 Authorization</li>
|
||||
<li><span class="icon">✅</span>当前模式读取</li>
|
||||
<li><span class="icon">✅</span>交互式错误观察</li>
|
||||
</ul>
|
||||
<a href="auth-lab.html" class="btn">开始实验 →</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🩺 修复验证实验室</h3>
|
||||
<p>自己点检查,不靠口头确认。直接验证 profile、H2、用户服务、MyBatis 和鉴权模式。</p>
|
||||
<ul class="feature-list">
|
||||
<li><span class="icon">✅</span>一键总览检查</li>
|
||||
<li><span class="icon">✅</span>数据库链路验证</li>
|
||||
<li><span class="icon">✅</span>用户服务验证</li>
|
||||
<li><span class="icon">✅</span>MyBatis 查询验证</li>
|
||||
</ul>
|
||||
<a href="verify-lab.html" class="btn">开始验证 →</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h3>🔌 API 测试面板</h3>
|
||||
<p>在线测试所有 API 接口,查看请求响应,理解 RESTful API 工作原理。</p>
|
||||
@@ -172,7 +244,7 @@
|
||||
</div>
|
||||
|
||||
<footer>
|
||||
<p>🍃 Spring Boot 学习脚手架 | <a href="/h2-console" target="_blank">H2 控制台</a> (JDBC: jdbc:h2:file:~/h2/springboot_scaffold, 用户: sa)</p>
|
||||
<p>🍃 Spring Boot 学习脚手架 | <a href="/h2-console" target="_blank">H2 控制台</a> (learn 模式 JDBC: jdbc:h2:mem:springboot_scaffold_learn, 用户: sa)</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
@@ -180,17 +252,19 @@
|
||||
// 加载状态数据
|
||||
async function loadStatus() {
|
||||
try {
|
||||
const [beans, users, products, orders] = await Promise.all([
|
||||
const [beans, users, products, orders, profile] = await Promise.all([
|
||||
fetch('/api/learning/ioc/beans').then(r => r.json()),
|
||||
fetch('/api/users/count').then(r => r.json()),
|
||||
fetch('/api/products').then(r => r.json()),
|
||||
fetch('/api/orders').then(r => r.json())
|
||||
fetch('/api/orders').then(r => r.json()),
|
||||
fetch('/api/profile').then(r => r.json())
|
||||
]);
|
||||
|
||||
document.getElementById('beanCount').textContent = beans.total || '-';
|
||||
document.getElementById('userCount').textContent = users.count || 0;
|
||||
document.getElementById('productCount').textContent = products.length || 0;
|
||||
document.getElementById('orderCount').textContent = orders.length || 0;
|
||||
document.getElementById('activeProfile').textContent = profile.profile || '-';
|
||||
} catch (e) {
|
||||
console.error('加载状态失败:', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user