login.ts 423 B

123456789101112131415161718192021
  1. import { WX_LOGIN } from '../utils/apiList'
  2. import { request, Response } from '../utils/http'
  3. interface LoginResType {
  4. token: string,
  5. sessionKey: string,
  6. wxUserId: string
  7. }
  8. type RoomDetailRes = Response & {
  9. data: LoginResType
  10. }
  11. export const Login = async (code: string): Promise<LoginResType> => {
  12. const res = await request.get<RoomDetailRes>(WX_LOGIN, {
  13. code
  14. })
  15. return res.data
  16. }