1.1.0 • Published 7 years ago

youzan-login v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

Youzan-Login

有赞 AppSDK 的登录态 API

Usage

const Youzan = require('../lib');

let youzan = new Youzan('client_id', 'client_secret');

let promise = youzan.initToken()
    .then(res => {
        //{
        //    "code": 0,
        //    "msg": "success",
        //    "data": {
        //        "access_token": "6460257b9aaf38c494d55a2c432bd4c9",
        //        "cookie_key": null,
        //        "cookie_value": null
        //    }
        //}
        return res;
    })
    .catch(e => {
        console.log(e);
        throw e;
    });

Apis

  • constructor (clientId: string, clientSecret: string) 初始化有赞工具型应用提供的 client_idclient_secret

  • initToken () 获取初始化 token

  • login () 登录

  • logout () 登出

1.1.0

7 years ago

1.0.0

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago