import { BaseModel, MysqlBaseService } from '../Database/Mysql/MysqlBaseService'; import { Errcode } from '../Config/_error_'; import { MysqlUserModel } from './MysqlUserService'; import { EAccountFrom } from './ini'; export declare class MysqlAccountModel extends BaseModel { id: number; phone: string; email: string; name: string; password: string; /** * 微信、QQ、OpenSocial、Apple、Google等三方登录的唯一标识 */ unionid: string; /** * 微信、QQ、OpenSocial、Apple、Google等三方登录的唯一标识 */ openid: string; create_time: number; create_ip: string; login_time: number; login_ip: string; from: number; state: number; } export declare class MysqlAccountService extends MysqlBaseService { /** * 注册新账号 * @param unionid * @param openid * @param ip * @param from */ add(unionid: string, openid: string, ip: string, from: EAccountFrom): Promise; /** * 通过第三方信息获取账号 * @param unionid * @param openid */ getByThird(unionid: string, openid: string): Promise; /** * 通过第三方信息获取账号 * @param unionid */ getByUnionid(unionid: string): Promise; getByPhone(phone: string): Promise; /** * 登陆接口 * @param unionid * @param openid * @param ip * @param from * @param access_token qq、wechat使用 */ login(unionid: string, openid: string, ip: string, from: EAccountFrom, force_user?: boolean, access_token?: string): Promise<{ errcode: Errcode | null; account: T | null; is_new: boolean; }>; protected _login(unionid: string, openid: string, from: EAccountFrom): Promise<{ errcode: Errcode | null; account: T | null; }>; register(type: EAccountFrom, key: string, password: string, ip: string, extra?: any): Promise<{ user: MysqlUserModel | null; errcode: Errcode | null; }>; }