import type { Response } from '@/utils/request' import { get, post } from '@/utils/request' /* get wechat-login senceStr */ export function fetchGetQRSceneStrAPI(data: {}): Promise> { return post({ url: '/official/getQRSceneStr', data, }) } /* get wechat-login qr url */ export function fetchGetQRCodeAPI(data: { sceneStr: string }): Promise> { return get({ url: '/official/getQRCode', data, }) } /* login by scenceStr */ export function fetchLoginBySceneStrAPI(data: { sceneStr: string }): Promise> { return post({ url: '/official/loginBySceneStr', data, }) } /* login by code */ export function fetchLoginByCodeAPI(data: { code: string }): Promise> { return post({ url: '/official/loginByCode', data, }) } /* get wx registery config */ export function fetchGetJsapiTicketAPI(data: { url: string }): Promise> { return post({ url: '/official/getJsapiTicket', data, }) } /* get wechat-login senceStr */ export function fetchGetQRSceneStrByBindAPI(): Promise> { return post({ url: '/official/getQRSceneStrByBind', }) } /* bind wx by scenceStr */ export function fetchBindWxBySceneStrAPI(data: { sceneStr: string }): Promise> { return post({ url: '/official/bindWxBySceneStr', data, }) } /* get wx rediriect login url */ export function fetchWxLoginRedirectAPI(data: { url: string }): Promise> { return post({ url: '/official/getRedirectUrl', data, }) } /* 实名认证 */ export function fetchVerifyIdentityAPI(data: { name: string idCard: string }): Promise> { return post({ url: '/auth/verifyIdentity', data, }) } /* 手机认证 */ export function fetchVerifyPhoneIdentityAPI(data: { phone: string username: string password: string code: string }): Promise> { return post({ url: '/auth/verifyPhoneIdentity', data, }) } /* 获取旧账号迁移二维码的sceneStr */ export function fetchGetQRSceneStrByOldWechatAPI(): Promise> { return post({ url: '/official/getQRSceneStrByOldWechat', }) } /* 轮询查询旧微信迁移结果 */ export function fetchBindWxByOldWechatAPI(data: { sceneStr: string }): Promise> { return post({ url: '/official/bindWxByOldWechat', data, }) } /* 获取旧公众号二维码(用于账号迁移) * 注意:此接口与普通二维码接口区别在于它返回的是旧公众号的二维码 * 后端API: /official/getOldQRCode */ export function fetchGetOldQRCodeAPI(data: { sceneStr: string }): Promise> { console.log('[API调试] 调用getOldQRCode接口, 参数:', data) return get({ url: '/official/getOldQRCode', data, // 使用data字段传递参数,会被转换为URL参数 }) }