@tnwx2/opencp
Version:
TTNWX 微信系开发脚手架之企业微信开放平台
45 lines (44 loc) • 1.86 kB
TypeScript
import { ApiConfig } from '@tnwx2/accesstoken';
/**
* @author Javen
* @copyright javendev@126.com
* @description 身份验证-网页授权登录、扫码授权登录
*/
export declare class OpenCpOauthApi {
private static authorizeUrl;
private static qrConnectUrl;
/**
* 构造网页授权链接
* @param suiteId 第三方应用id
* @param redirectUri 授权后重定向的回调链接地址
* @param scope 应用授权作用域。
* @param state 重定向后会带上state参数,企业可以填写a-zA-Z0-9的参数值,长度不可超过128个字节
*/
static getAuthorizeUrl(suiteId: string, redirectUri: string, scope: string, state?: string): string;
/**
* 构造扫码登录链接
* @param corpId 服务商的corpId
* @param redirectUri 授权登录之后目的跳转网址
* @param state 重定向后会带上state参数
* @param userType 支持登录的类型。admin代表管理员登录(使用微信扫码),member代表成员登录(使用企业微信扫码),默认为admin
*/
static getQrConnect(corpId: string, redirectUri: string, state?: string, userType?: string): string;
private static getUserInfoUrl;
/**
* 根据 code 获取成员信息
* @param code 通过成员授权获取到的 code
*/
static getUserInfo(apiConfig: ApiConfig, code: string): Promise<any>;
private static getUserDetailUrl;
/**
* 获取访问用户敏感信息
* @param userTicket 成员票据
*/
static getUserDetail(apiConfig: ApiConfig, userTicket: string): Promise<any>;
private static getLoginInfoUrl;
/**
* 获取登录用户信息
* @param authCode oauth2.0授权企业微信管理员登录产生的code
*/
static getLoginInfo(apiConfig: ApiConfig, authCode: string): Promise<any>;
}