mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
支持clientid登录
This commit is contained in:
@@ -12,7 +12,10 @@ import 'package:qinglong_app/module/task/task_bean.dart';
|
||||
import 'url.dart';
|
||||
|
||||
class Api {
|
||||
static Future<HttpResponse<LoginBean>> login(String userName, String passWord) async {
|
||||
static Future<HttpResponse<LoginBean>> login(
|
||||
String userName,
|
||||
String passWord,
|
||||
) async {
|
||||
return await Http.post<LoginBean>(
|
||||
Url.login,
|
||||
{
|
||||
@@ -22,6 +25,19 @@ class Api {
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<LoginBean>> loginByClientId(
|
||||
String id,
|
||||
String secret,
|
||||
) async {
|
||||
return await Http.post<LoginBean>(
|
||||
Url.loginByClientId,
|
||||
{
|
||||
"client_id": id,
|
||||
"client_secret": secret,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
static Future<HttpResponse<UserBean>> user() async {
|
||||
return await Http.get<UserBean>(
|
||||
Url.user,
|
||||
|
||||
Reference in New Issue
Block a user