|
|
@@ -21,36 +21,37 @@ class MobileCyberGamesApp extends StatelessWidget {
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return StoreProvider(
|
|
|
- store: this.store,
|
|
|
- child: new MaterialApp(
|
|
|
- title: '全民电竞',
|
|
|
- supportedLocales: [
|
|
|
- const Locale('en'), // English
|
|
|
- const Locale('zh'), // China
|
|
|
- ],
|
|
|
- localizationsDelegates: [
|
|
|
- GlobalMaterialLocalizations.delegate,
|
|
|
- GlobalWidgetsLocalizations.delegate,
|
|
|
- ChineseCupertinoLocalizations.delegate,
|
|
|
- ],
|
|
|
- theme: ThemeData(
|
|
|
- cardColor: Color(0xFF2B2B42),
|
|
|
- backgroundColor: Color(0xFF222335),
|
|
|
- primaryColor: Color(0xFFC2524D),
|
|
|
- buttonColor: Color(0xFFC2524D),
|
|
|
+ store: this.store,
|
|
|
+ child: new MaterialApp(
|
|
|
+ title: '全民电竞',
|
|
|
+ supportedLocales: [
|
|
|
+ const Locale('en'), // English
|
|
|
+ const Locale('zh'), // China
|
|
|
+ ],
|
|
|
+ localizationsDelegates: [
|
|
|
+ GlobalMaterialLocalizations.delegate,
|
|
|
+ GlobalWidgetsLocalizations.delegate,
|
|
|
+ ChineseCupertinoLocalizations.delegate,
|
|
|
+ ],
|
|
|
+ theme: ThemeData(
|
|
|
+ cardColor: Color(0xFF2B2B42),
|
|
|
+ backgroundColor: Color(0xFF222335),
|
|
|
+ primaryColor: Color(0xFFC2524D),
|
|
|
+ buttonColor: Color(0xFFC2524D),
|
|
|
// highlightColor: Color(0xFF933E3E),
|
|
|
- accentColor: Color(0xFFC2524D),
|
|
|
- textSelectionColor: Colors.white,
|
|
|
- textTheme: TextTheme(
|
|
|
- subhead: TextStyle(color: Colors.white),
|
|
|
- ),
|
|
|
- buttonTheme: ButtonThemeData(
|
|
|
- buttonColor: Color(0xFFC2524D),
|
|
|
- highlightColor: Color(0xFF9B4040),
|
|
|
- splashColor: Color(0xFF9B4040),
|
|
|
- )),
|
|
|
- home: store.state.isLogin ? HomePage() : LoginFirst(),
|
|
|
- ));
|
|
|
+ accentColor: Color(0xFFC2524D),
|
|
|
+ textSelectionColor: Colors.white,
|
|
|
+ textTheme: TextTheme(
|
|
|
+ subhead: TextStyle(color: Colors.white),
|
|
|
+ ),
|
|
|
+ buttonTheme: ButtonThemeData(
|
|
|
+ buttonColor: Color(0xFFC2524D),
|
|
|
+ highlightColor: Color(0xFF9B4040),
|
|
|
+ splashColor: Color(0xFF9B4040),
|
|
|
+ )),
|
|
|
+ home: store.state.isLogin ? HomePage() : LoginFirst(),
|
|
|
+ ),
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -60,17 +61,20 @@ void main() async {
|
|
|
));
|
|
|
final prefs = await SharedPreferences.getInstance();
|
|
|
print(prefs.getString('token'));
|
|
|
+<<<<<<< HEAD
|
|
|
//测试token
|
|
|
// HttpManager.token=prefs.getString('token')??"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiIyZDExNzgzOS1lZTQxLTRmZjItOGMyYi0zMzdiNmVhYWE3ODUiLCJpc3MiOiJhZG1pbiIsImlhdCI6MTU1MTMzNjAxNiwic3ViIjoiODQ3MDIiLCJleHAiOjE1NTE1OTUyMTZ9.VFvZRMpAvrPos5FwgkaofVemgb5rAXVuGTOSiHcNEKw";
|
|
|
HttpManager.token = prefs.getString('token') ??
|
|
|
"eyJhbGciOiJIUzI1NiJ9.eyJqdGkiOiI0NWY0OGY2NS1jODQxLTRjNDgtYmY0My1jYTAwYzlkZjk5OWQiLCJpc3MiOiJhZG1pbiIsImlhdCI6MTU1MTMxNzAzMCwic3ViIjoiODQ3MDIiLCJleHAiOjE1NTE1NzYyMzB9.ILhuOwvblQKqVxNaLk9CbYas6aoUQAlzlZrTk4VLqY8";
|
|
|
+=======
|
|
|
+ HttpManager.token = prefs.getString('token') ?? "";
|
|
|
+>>>>>>> 65218265d3d6138b9ff40fedea1d84f50cb8d8d9
|
|
|
Result result = await HttpManager.get("userInfo/getUserInfo");
|
|
|
AppState state = AppState.empty();
|
|
|
if (result.success && result.data != null) {
|
|
|
state.isLogin = true;
|
|
|
UserInfo userInfo = UserInfo.fromJson(result.data);
|
|
|
state.userInfo = userInfo;
|
|
|
- prefs.setString("token", result.token);
|
|
|
} else {
|
|
|
state.isLogin = false;
|
|
|
}
|