@@ -217,8 +207,6 @@ export default function StoreDetailPage() {
)}
-
- {toast &&
{toast}
}
);
}
diff --git a/apps/h5-partner/src/pages/StoreListPage.tsx b/apps/h5-partner/src/pages/StoreListPage.tsx
index 5f59ef5..d6da1ff 100644
--- a/apps/h5-partner/src/pages/StoreListPage.tsx
+++ b/apps/h5-partner/src/pages/StoreListPage.tsx
@@ -52,8 +52,8 @@ export default function StoreListPage() {
body: JSON.stringify({ status: next }),
});
await loadStores();
- } catch (e) {
- setError(e instanceof Error ? e.message : '状态更新失败');
+ } catch {
+ /* request 已 toast */
} finally {
setUpdatingId(null);
}
diff --git a/apps/h5-partner/src/styles.css b/apps/h5-partner/src/styles.css
index f7b40f1..b091939 100644
--- a/apps/h5-partner/src/styles.css
+++ b/apps/h5-partner/src/styles.css
@@ -2076,6 +2076,13 @@ nav.app-tabbar .app-tabbar-label {
border-radius: 8px;
font-size: 14px;
z-index: 10001;
+ max-width: min(320px, calc(100vw - 40px));
+ text-align: center;
+ line-height: 1.5;
+}
+
+.partner-toast--error {
+ background: rgba(166, 29, 36, 0.92);
}
/* ── Orders ── */
diff --git a/server/dukang-api/src/common/parse-bigint.ts b/server/dukang-api/src/common/parse-bigint.ts
new file mode 100644
index 0000000..1d89e4d
--- /dev/null
+++ b/server/dukang-api/src/common/parse-bigint.ts
@@ -0,0 +1,13 @@
+import { BadRequestException } from '@nestjs/common';
+
+export function parseBigIntParam(value: unknown, label = 'ID'): bigint {
+ const text = String(value ?? '').trim();
+ if (!/^\d+$/.test(text)) {
+ throw new BadRequestException(`${label}格式无效`);
+ }
+ try {
+ return BigInt(text);
+ } catch {
+ throw new BadRequestException(`${label}格式无效`);
+ }
+}
diff --git a/server/dukang-api/src/modules/store/store.service.ts b/server/dukang-api/src/modules/store/store.service.ts
index 7219094..cdd47b6 100644
--- a/server/dukang-api/src/modules/store/store.service.ts
+++ b/server/dukang-api/src/modules/store/store.service.ts
@@ -9,6 +9,7 @@ import { PARTNER_STAFF_ROLE_LABELS, PartnerStaffRole, type PartnerLeaderboardPer
import { PrismaService } from '../../common/prisma/prisma.module';
import { serializeBigInt } from '../../common/decorators/current-user.decorator';
import { mapStoreCompat } from '../../common/compat/v31-compat';
+import { parseBigIntParam } from '../../common/parse-bigint';
import { AnalyticsService } from '../analytics/analytics.service';
@Injectable()
@@ -133,7 +134,7 @@ export class StoreService {
data: {
cityId: city.id,
partnerId: account.partnerId,
- categoryId: body.categoryId ? BigInt(String(body.categoryId)) : null,
+ categoryId: body.categoryId ? parseBigIntParam(body.categoryId, '分类ID') : null,
name: String(body.name),
phone: normalizedPhone,
province: String(body.province ?? city.province ?? '河南省'),
@@ -226,7 +227,12 @@ export class StoreService {
extraJson: { storeName: store.name, phone: normalizedPhone },
});
- return serializeBigInt({ store, audit });
+ return serializeBigInt({
+ store: mapStoreCompat({
+ ...store,
+ coverResource: coverUrl ? { url: coverUrl } : null,
+ }),
+ });
}
async partnerUpdateStoreStatus(
@@ -681,7 +687,7 @@ export class StoreService {
private async resolvePartnerCity(partnerId: bigint, cityId: unknown) {
if (cityId) {
const city = await this.prisma.commonCity.findFirst({
- where: { id: BigInt(String(cityId)), partnerId },
+ where: { id: parseBigIntParam(cityId, '城市ID'), partnerId },
});
if (!city) throw new BadRequestException('所选地区未匹配到开城城市');
return city;