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
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
Widget build(BuildContext context, WidgetRef ref) {
|
||||||
final user = ref.watch(userNotifierProvider);
|
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;
|
final asset = assetAsync.valueOrNull;
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -38,7 +40,7 @@ class AssetPage extends ConsumerWidget {
|
||||||
builder: (context, constraints) {
|
builder: (context, constraints) {
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
ref.invalidate(myAssetProvider);
|
ref.invalidate(accountAssetProvider(accountSequence));
|
||||||
},
|
},
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue