跳到主要内容

bn.getUserOpenid

getUserOpenid(): Promise<GetUserOpenidResponse>

description Get user’s openid for the mini program.

remark support jssdk >= 4.7.0

example

 const response = await bn.getUserOpenid()

Returns

Promise<GetUserOpenidResponse>

GetUserOpenidResponse


Interface: GetUserOpenidResponse

NameTypeDescription
openId?stringuser’s openid(Native does not return the openId field after 4.10.0)
tokenstringencrypted token