增加client_id登录方式

This commit is contained in:
NewTab
2022-01-19 20:35:14 +08:00
parent e8694643d8
commit 364c0da236
5 changed files with 33 additions and 16 deletions

View File

@@ -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登录
>* 脚本管理中的增删改和调试

View File

@@ -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;

View File

@@ -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<OtherPage> {
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<OtherPage> {
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<OtherPage> {
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<OtherPage> {
GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () {
Navigator.of(context).pushNamed(
Routes.routeLoginLog,
);
if (getIt<UserInfoViewModel>().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<OtherPage> {
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<OtherPage> {
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<OtherPage> {
child: const Text("确定"),
onPressed: () {
getIt<UserInfoViewModel>().updateToken("");
Navigator.of(context).pushReplacementNamed(Routes.routeLogin);
Navigator.of(context)
.pushReplacementNamed(Routes.routeLogin);
},
),
],

View File

@@ -170,7 +170,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
height: 5,
),
const Text(
"定时的cron不校验,自己确保写的是正确的cron",
"定时的cron不校验是否正确",
style: TextStyle(
fontSize: 12,
),

View File

@@ -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"