This commit is contained in:
2022-11-02 10:02:28 +08:00
parent 543dd6adb4
commit 8c6d1b2add
7 changed files with 49 additions and 29 deletions

View File

@@ -0,0 +1,19 @@
import 'package:chat/utils/network/http.dart';
import 'package:chat/utils/ui_tools.dart';
class PublicProvider {
/// 检测更新
static Future checkUpgrade() async {
try {
return await Http.get(
'version/check',
params: {
'version': '',
},
);
} catch (e) {
UiTools.toast(e.toString());
}
return null;
}
}

View File

@@ -73,7 +73,21 @@ class UserProvider {
return null;
}
static Future updateMobile(String mobile) async {}
static Future updateMobile(String mobile) async {
try {
return await Http.post('user/mobile');
} catch (e) {
UiTools.toast(e.toString());
}
return null;
}
static Future updateEmail(String email) async {}
static Future updateEmail(String email) async {
try {
return await Http.post('user/email');
} catch (e) {
UiTools.toast(e.toString());
}
return null;
}
}

View File

@@ -63,6 +63,7 @@ class _UserSettingPageState extends State<UserSettingPage> {
const SizedBox(height: 8),
ActionItem(
'版本更新',
extend: '1.0.0',
isFirst: true,
isLast: true,
onTap: () {},

View File

@@ -49,7 +49,7 @@ class _UserSettingSafePageState extends State<UserSettingSafePage> {
),
const SizedBox(height: 8),
ActionItem(
'开启两验证',
'开启两验证',
extend: (_.userInfo.value.google2fa ?? false) ? '已开启' : '未开启',
isFirst: true,
isLast: true,

View File

@@ -9,7 +9,9 @@ class UserSettingSafeMobilePage extends StatelessWidget {
appBar: AppBar(
title: const Text('绑定手机'),
),
body: Container(),
body: Column(
children: const [],
),
);
}
}