• 获取token

    let code = ctx.getHttp().request.queries["code"]
    let tokenConfPara:oauth.AuthTokenParameters ={
    client_id: "xxxx8484283fc25ba0a207ea7",
    client_secret: "xxxxxxxxxxxxx", // 此为敏感信息,请不要在源代码中直接写明文。
    redirect_url:"xxx.com",
    scopes:["read", "write"],
    state:"ss",
    token_url:"xxx.com/baas/auth/v1.0/oauth2/token",
    auth_style: oauth.AuthStye.AuthStyleInParams,
    code: code,
    opts: {
    "appid":"xxxxa6fde11f686edbe0"
    }
    }
    let token=oauth.getToken(tokenConfPara)

    Parameters

    Returns Token