-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathUnit9.pas
99 lines (74 loc) · 2.46 KB
/
Unit9.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
unit Unit9;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
uTiktokAPI,
uBaseThirdPartyAccountAuthLogin,
FMX.Controls.Presentation, FMX.StdCtrls, FMX.Edit;
type
TForm9 = class(TForm)
AuthLogin: TButton;
edtAccessToken: TEdit;
btnGetUserInfo: TButton;
btnGetVideoList: TButton;
btnUploadVideo: TButton;
btnGetQRCode: TButton;
procedure AuthLoginClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnGetUserInfoClick(Sender: TObject);
procedure btnGetVideoListClick(Sender: TObject);
procedure btnUploadVideoClick(Sender: TObject);
procedure btnGetQRCodeClick(Sender: TObject);
private
FTiktokAPI:TTiktokAPI;
procedure DoAuthLoginEnd(Sender:TObject;AIsSucc:Boolean;ADesc:String;AAuthLoginUserInfo:TAuthLoginUserInfo);
{ Private declarations }
public
{ Public declarations }
end;
var
Form9: TForm9;
implementation
{$R *.fmx}
procedure TForm9.AuthLoginClick(Sender: TObject);
begin
//Auth Login
// Self.edtAuthUrl.Text:=FTiktokAPI.GetAuthUrl;
FTiktokAPI.AuthLogin;
// frmTiktokAuthLogin:=TfrmTiktokAuthLogin.Create(Application);
// frmTiktokAuthLogin.FAuthUrl:=Self.edtAuthUrl.Text;
// frmTiktokAuthLogin.Show;
end;
procedure TForm9.btnGetQRCodeClick(Sender: TObject);
begin
FTiktokAPI.GetAuthQRCode;
end;
procedure TForm9.btnGetUserInfoClick(Sender: TObject);
begin
FTiktokAPI.GetUserInfo;
end;
procedure TForm9.btnGetVideoListClick(Sender: TObject);
begin
FTiktokAPI.GetVideoList;
end;
procedure TForm9.btnUploadVideoClick(Sender: TObject);
begin
FTiktokAPI.UploadVideo('C:\Users\ggggcexx\Videos\3CAD08A3352A612331AD842B9AC289AB.mp4');
end;
procedure TForm9.DoAuthLoginEnd(Sender: TObject;AIsSucc:Boolean;ADesc:String;AAuthLoginUserInfo:TAuthLoginUserInfo);
begin
//½«AccessTokenÏÔʾÔÚ½çÃæÉÏ
Self.edtAccessToken.Text:=FTiktokAPI.FAuthLoginUserInfo.FAccessToken;
end;
procedure TForm9.FormCreate(Sender: TObject);
begin
FTiktokAPI:=TTiktokAPI.Create;
FTiktokAPI.FClientKey:='aw6noplqmphvn7sp';
FTiktokAPI.FClientSecret:='78448dc7ca3eee1a2e1bc6dd38febaa5';
FTiktokAPI.FCallbackUrl:='orangeui.cn';
FTiktokAPI.FAuthLoginUserInfo.FAccessToken:='act.69d080157109c46872f8438275a1d4b55ZH85DkNXIOe5OHBWEQeU1eZTMqN!6385';
FTiktokAPI.FAuthLoginUserInfo.FOpenID:='ab4ef122-d7b0-45bc-9083-7f132e32c345';
FTiktokAPI.FOnAuthLoginEnd:=DoAuthLoginEnd;
end;
end.