门店账号管理修改

This commit is contained in:
2026-07-07 00:01:16 +08:00
parent e85c4b9bcb
commit 7ca9fc8a35
25 changed files with 599 additions and 134 deletions
+16
View File
@@ -121,6 +121,15 @@ async function main() {
body: JSON.stringify({ couponId: coupons[0].id, amount: Number(coupons[0].balance) + 1 }),
});
console.log('7b. Shop sms guard + session');
const unboundMsg = await expectFail('SHOP_H5', '/shop/auth/sms/send', {
method: 'POST',
body: JSON.stringify({ phone: '13899999999', scene: 'STORE_LOGIN' }),
});
if (!unboundMsg.includes('未绑定门店')) {
throw new Error(`Expected unbound store message, got: ${unboundMsg}`);
}
console.log('8. Shop confirm redeem');
const shopLogin = await loginSms(
'SHOP_H5',
@@ -129,6 +138,13 @@ async function main() {
'/shop/auth/login/sms',
'/shop/auth/sms/send',
);
const shopMe = await req('SHOP_H5', '/shop/auth/me', { token: shopLogin.accessToken });
if (!shopMe?.phone) throw new Error('Shop /shop/auth/me failed');
const refreshed = await req('SHOP_H5', '/shop/auth/token/refresh', {
method: 'POST',
body: JSON.stringify({ refreshToken: shopLogin.refreshToken }),
});
if (!refreshed?.accessToken) throw new Error('Shop token refresh failed');
const preview = await req('SHOP_H5', '/shop/redeem/preview', {
method: 'POST',
token: shopLogin.accessToken,