From 364c0da2363bb6aef014235b5d0d1490ba5aef62 Mon Sep 17 00:00:00 2001 From: NewTab <425698907@qq.com> Date: Wed, 19 Jan 2022 20:35:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0client=5Fid=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 ++-- lib/base/userinfo_viewmodel.dart | 2 +- lib/module/others/other_page.dart | 38 ++++++++++++++++++++++-------- lib/module/task/add_task_page.dart | 2 +- pubspec.yaml | 2 +- 5 files changed, 33 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 81373c1..0177036 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Android端去[release](https://github.com/qinglong-app/qinglong_app/releases)下载 -本人没有iOS开发者账号,iOS端用户自行下载main分支源码编译安装 +iOS端暂无上架打算,用户自行下载main分支源码编译安装 目前只支持用户名密码登录,不用担心,你的用户名密码不会泄露 @@ -43,5 +43,4 @@ Android端去[release](https://github.com/qinglong-app/qinglong_app/releases)下 >* 两步验证 >* 应用设置 >* 通知设置 ->* 脚本管理中的增删改和调试 ->* 暂不支持通过Client ID/Client Secret登录 +>* 脚本管理中的增删改和调试 diff --git a/lib/base/userinfo_viewmodel.dart b/lib/base/userinfo_viewmodel.dart index 2712ba7..ab33602 100644 --- a/lib/base/userinfo_viewmodel.dart +++ b/lib/base/userinfo_viewmodel.dart @@ -15,7 +15,7 @@ class UserInfoViewModel { _passWord = SpUtil.getString(spPassWord); _useSecertLogined = SpUtil.getBool(spSecretLogined, defValue: false); - _host = SpUtil.getString(spHost, defValue: 'http://1.1.1.1:5700'); + _host = SpUtil.getString(spHost, defValue: ''); if (userInfoJson.isNotEmpty) { _token = userInfoJson; diff --git a/lib/module/others/other_page.dart b/lib/module/others/other_page.dart index 767d150..15df6ca 100644 --- a/lib/module/others/other_page.dart +++ b/lib/module/others/other_page.dart @@ -5,7 +5,7 @@ import 'package:qinglong_app/base/routes.dart'; import 'package:qinglong_app/base/theme.dart'; import 'package:qinglong_app/base/userinfo_viewmodel.dart'; import 'package:qinglong_app/main.dart'; - +import 'package:qinglong_app/utils/extension.dart'; class OtherPage extends ConsumerStatefulWidget { const OtherPage({Key? key}) : super(key: key); @@ -57,7 +57,10 @@ class _OtherPageState extends ConsumerState { Text( "脚本管理", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -90,7 +93,10 @@ class _OtherPageState extends ConsumerState { Text( "依赖管理", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -123,7 +129,10 @@ class _OtherPageState extends ConsumerState { Text( "任务日志", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -142,9 +151,13 @@ class _OtherPageState extends ConsumerState { GestureDetector( behavior: HitTestBehavior.opaque, onTap: () { - Navigator.of(context).pushNamed( - Routes.routeLoginLog, - ); + if (getIt().useSecretLogined) { + "使用client_id方式登录无法获取登录日志".toast(); + } else { + Navigator.of(context).pushNamed( + Routes.routeLoginLog, + ); + } }, child: Padding( padding: const EdgeInsets.symmetric( @@ -157,7 +170,10 @@ class _OtherPageState extends ConsumerState { Text( "登录日志", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: ref + .watch(themeProvider) + .themeColor + .titleColor(), fontSize: 16, ), ), @@ -201,7 +217,8 @@ class _OtherPageState extends ConsumerState { Text( "夜间模式", style: TextStyle( - color: ref.watch(themeProvider).themeColor.titleColor(), + color: + ref.watch(themeProvider).themeColor.titleColor(), fontSize: 16, ), ), @@ -250,7 +267,8 @@ class _OtherPageState extends ConsumerState { child: const Text("确定"), onPressed: () { getIt().updateToken(""); - Navigator.of(context).pushReplacementNamed(Routes.routeLogin); + Navigator.of(context) + .pushReplacementNamed(Routes.routeLogin); }, ), ], diff --git a/lib/module/task/add_task_page.dart b/lib/module/task/add_task_page.dart index dbbcef7..5f6c575 100644 --- a/lib/module/task/add_task_page.dart +++ b/lib/module/task/add_task_page.dart @@ -170,7 +170,7 @@ class _AddTaskPageState extends ConsumerState { height: 5, ), const Text( - "定时的cron不校验,自己确保写的是正确的cron", + "定时的cron不校验是否正确", style: TextStyle( fontSize: 12, ), diff --git a/pubspec.yaml b/pubspec.yaml index a0e0ecd..f257197 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: qinglong_app description: A new Flutter project. publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.0+1 +version: 1.0.1+2 environment: sdk: ">=2.15.1 <3.0.0"