fix(mining-app): use public API for asset page to avoid JWT mismatch
Changed from myAssetProvider (requires JWT) to accountAssetProvider (public API) to avoid 401 errors when trading-service JWT_SECRET doesn't match auth-service. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
4cef31b1d1
commit
4b1855f57a
|
|
@ -24,10 +24,12 @@ class AssetPage extends ConsumerWidget {
|
|||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final user = ref.watch(userNotifierProvider);
|
||||
final assetAsync = ref.watch(myAssetProvider);
|
||||
final accountSequence = user.accountSequence ?? '';
|
||||
// 使用 public API,不依赖 JWT token
|
||||
final assetAsync = ref.watch(accountAssetProvider(accountSequence));
|
||||
|
||||
// 提取数据和加载状态
|
||||
final isLoading = assetAsync.isLoading;
|
||||
final isLoading = assetAsync.isLoading || accountSequence.isEmpty;
|
||||
final asset = assetAsync.valueOrNull;
|
||||
|
||||
return Scaffold(
|
||||
|
|
@ -38,7 +40,7 @@ class AssetPage extends ConsumerWidget {
|
|||
builder: (context, constraints) {
|
||||
return RefreshIndicator(
|
||||
onRefresh: () async {
|
||||
ref.invalidate(myAssetProvider);
|
||||
ref.invalidate(accountAssetProvider(accountSequence));
|
||||
},
|
||||
child: SingleChildScrollView(
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue