增加client_id登录方式

This commit is contained in:
NewTab
2022-01-19 19:39:25 +08:00
parent 6dbed6cf49
commit e8694643d8
14 changed files with 415 additions and 281 deletions

View File

@@ -88,7 +88,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 10,
height: 15,
),
const Text(
"名称:",
@@ -97,9 +97,6 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
fontWeight: FontWeight.w600,
),
),
const SizedBox(
height: 10,
),
TextField(
focusNode: focusNode,
controller: _nameController,
@@ -121,7 +118,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 10,
height: 15,
),
const Text(
"命令:",
@@ -130,9 +127,6 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
fontWeight: FontWeight.w600,
),
),
const SizedBox(
height: 10,
),
TextField(
controller: _commandController,
maxLines: 4,
@@ -155,7 +149,7 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const SizedBox(
height: 10,
height: 15,
),
const Text(
"定时:",
@@ -164,9 +158,6 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
fontWeight: FontWeight.w600,
),
),
const SizedBox(
height: 10,
),
TextField(
controller: _cronController,
decoration: const InputDecoration(
@@ -213,10 +204,12 @@ class _AddTaskPageState extends ConsumerState<AddTaskPage> {
taskBean.name = _nameController.text;
taskBean.command = _commandController.text;
taskBean.schedule = _cronController.text;
HttpResponse<NullResponse> response = await Api.addTask(_nameController.text, _commandController.text, _cronController.text, id: taskBean.sId);
HttpResponse<NullResponse> response = await Api.addTask(
_nameController.text, _commandController.text, _cronController.text,
id: taskBean.sId);
if (response.success) {
"操作成功".toast();
(widget.taskBean?.sId == null) ? "新增成功" : "修改成功".toast();
ref.read(taskProvider).updateBean(taskBean);
Navigator.of(context).pop();
} else {