Douyin Account Information Retrieval Development Record
AccountInfo Implementation
We first defined the AccountInfo
type for storing account information.
And attached it to the Platform
type.
Then use the methods in the src/sync/account.ts
file to get account information.
Douyin Account Information Retrieval
To display the currently logged-in account information to users on the frontend, we need to get Douyin account information.
The specific implementation is in the src/sync/account/douyin.ts
file.
Through F12 in the Douyin backend, we found this interface for getting user information. After using fetch to get user information, we can display the currently logged-in account information to users on the frontend.
Then we mount this function to the getAccountInfo
method in the src/sync/account.ts
file.
The provider
corresponds to the accountKey
in PlatformInfo
. Platform information will look up the corresponding account information in storage when returning.
Mission Accomplished
Through the above steps, we can get Douyin account information and display it to users.