feat(sae): add Java MVP backend and Taobao connectivity page

Spring Boot 3.5.6 / Java 17 JAR with cloud gateway envelope and ping/whoami/echo; Taobao gateway signature verification matching the Node implementation; /pages/mvp page, splash dev entry and local transport contract test; SAE + 聚石塔 runbook and portable JDK/Maven setup; Windows 11 wmic shim for Taobao DevTools.
This commit is contained in:
xsl
2026-10-31 18:35:04 +08:00
parent 459e21dad4
commit ac0b7ca42b
25 changed files with 1334 additions and 2 deletions
+91
View File
@@ -0,0 +1,91 @@
.mvp {
min-height: 100vh;
box-sizing: border-box;
padding: 48rpx 32rpx 64rpx;
background: #101823;
color: #F5F5F5;
}
.mvp-head {
margin-bottom: 32rpx;
}
.mvp-kicker {
display: block;
color: #F5F078;
font-size: 24rpx;
letter-spacing: 2rpx;
margin-bottom: 12rpx;
}
.mvp-title {
display: block;
font-size: 44rpx;
font-weight: 700;
line-height: 1.3;
}
.mvp-sub {
display: block;
color: #9AA4B2;
font-size: 26rpx;
margin-top: 10rpx;
}
.mvp-card {
background: #1B2634;
border: 1rpx solid #2A3748;
border-radius: 20rpx;
padding: 28rpx;
margin-bottom: 28rpx;
}
.mvp-label {
color: #9AA4B2;
font-size: 24rpx;
margin-bottom: 16rpx;
}
.mvp-code {
display: block;
color: #E8EDF4;
font-family: Menlo, Consolas, monospace;
font-size: 24rpx;
line-height: 1.6;
white-space: pre-wrap;
word-break: break-all;
}
.mvp-actions {
display: flex;
flex-direction: column;
gap: 16rpx;
margin-bottom: 28rpx;
}
.mvp-btn {
height: 88rpx;
line-height: 88rpx;
border-radius: 44rpx;
background: #243244;
color: #E8EDF4;
font-size: 28rpx;
border: none;
}
.mvp-btn::after {
border: none;
}
.mvp-btn-primary {
background: #F5F078;
color: #101823;
font-weight: 600;
}
.mvp-tip {
color: #7F8A99;
font-size: 24rpx;
line-height: 1.7;
padding: 0 8rpx;
}
+28
View File
@@ -0,0 +1,28 @@
<view class="mvp">
<view class="mvp-head">
<text class="mvp-kicker">SAE + 淘宝云应用</text>
<text class="mvp-title">最小连通性验证</text>
<text class="mvp-sub">Java 后端 / 云网关统一响应</text>
</view>
<view class="mvp-card">
<view class="mvp-label">当前 config.js</view>
<text class="mvp-code">{{configText}}</text>
</view>
<view class="mvp-actions">
<button class="mvp-btn mvp-btn-primary" onTap="onPing" loading="{{loading}}">POST /api/taobao/ping</button>
<button class="mvp-btn" onTap="onWhoami" loading="{{loading}}">POST /api/taobao/whoami</button>
<button class="mvp-btn" onTap="onEcho" loading="{{loading}}">POST /api/taobao/echo</button>
<button class="mvp-btn" onTap="onBack">返回首页</button>
</view>
<view class="mvp-card">
<view class="mvp-label">返回(已由 transport.unwrap 解包)</view>
<text class="mvp-code">{{resultText}}</text>
</view>
<view class="mvp-tip">
本地调试:config.transport = direct,baseUrl 指向 127.0.0.1。云端:transport = cloud,baseUrl 必须是 HTTPS,并填写 cloudAppId/cloudEnv。
</view>
</view>
+63
View File
@@ -0,0 +1,63 @@
var config = require('../../config');
var transport = require('../../utils/transport');
var original = { transport: config.transport, baseUrl: config.baseUrl };
if (config.mvpLocal) {
config.transport = 'direct';
config.baseUrl = config.mvpBaseUrl;
}
Page({
data: {
configText: '',
resultText: '',
loading: false
},
onLoad: function () {
this.setData({
configText: JSON.stringify({
environment: config.environment,
transport: config.transport,
baseUrl: config.baseUrl,
cloudAppId: config.cloudAppId || '(empty)',
cloudEnv: config.cloudEnv
}, null, 2)
});
this.onPing();
},
call: function (path, body) {
var that = this;
this.setData({ loading: true, resultText: '请求中...' });
transport.request(path, body || {}).then(function (data) {
that.setData({ loading: false, resultText: JSON.stringify(data, null, 2) });
}).catch(function (err) {
that.setData({
loading: false,
resultText: 'ERROR: ' + (err && err.message ? err.message : String(err))
});
});
},
onPing: function () {
this.call('/api/taobao/ping', {});
},
onWhoami: function () {
this.call('/api/taobao/whoami', {});
},
onEcho: function () {
this.call('/api/taobao/echo', { hello: 'world', at: Date.now() });
},
onBack: function () {
my.navigateBack();
},
onUnload: function () {
config.transport = original.transport;
config.baseUrl = original.baseUrl;
}
});
+5
View File
@@ -0,0 +1,5 @@
{
"defaultTitle": "SAE 连通性 MVP",
"titleBarColor": "#101823",
"backgroundColor": "#101823"
}