-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { ChronocatContext, Login } from '@chronocat/shell' | ||
import { LoginStatus } from '@chronocat/shell' | ||
|
||
export const buildLoginGet = (ctx: ChronocatContext) => async () => { | ||
const authData = await ctx.chronocat.getAuthData() | ||
|
||
const result: Login = { | ||
user: { | ||
id: authData.uin, | ||
avatar: `http://thirdqq.qlogo.cn/headimg_dl?dst_uin=${authData.uin}&spec=640`, | ||
}, | ||
self_id: authData.uin, | ||
platform: ctx.chronocat.platform, | ||
status: LoginStatus.ONLINE, | ||
} | ||
|
||
return result | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import type { RouteContext } from '../types' | ||
|
||
export const loginGet = ({ cctx }: RouteContext) => | ||
cctx.chronocat.api['login.get']() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters