mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
Merge branch 'dev' of https://github.com/qinglong-app/qinglong_app into dev
This commit is contained in:
@@ -29,7 +29,7 @@ class Api {
|
||||
String id,
|
||||
String secret,
|
||||
) async {
|
||||
return await Http.post<LoginBean>(
|
||||
return await Http.get<LoginBean>(
|
||||
Url.loginByClientId,
|
||||
{
|
||||
"client_id": id,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:qinglong_app/base/http/url.dart';
|
||||
import 'package:qinglong_app/main.dart';
|
||||
|
||||
import '../userinfo_viewmodel.dart';
|
||||
@@ -15,8 +16,10 @@ class TokenInterceptor extends Interceptor {
|
||||
options.headers["User-Agent"] =
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1";
|
||||
options.headers["Content-Type"] = "application/json;charset=UTF-8";
|
||||
options.queryParameters["t"] =
|
||||
(DateTime.now().millisecondsSinceEpoch ~/ 1000).toString();
|
||||
if (options.path != Url.loginByClientId) {
|
||||
options.queryParameters["t"] =
|
||||
(DateTime.now().millisecondsSinceEpoch ~/ 1000).toString();
|
||||
}
|
||||
return handler.next(options);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class Url {
|
||||
static const loginByClientId = "/open/auth/token";
|
||||
static const user = "/api/user";
|
||||
|
||||
static get tasks => getIt<UserInfoViewModel>().useSecretLogined ? "/open/user/login" : "/api/crons";
|
||||
static get tasks => getIt<UserInfoViewModel>().useSecretLogined ? "/open/crons" : "/api/crons";
|
||||
|
||||
static get runTasks => getIt<UserInfoViewModel>().useSecretLogined ? "/open/crons/run" : "/api/crons/run";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user