Skip to content

leaf4monkey-npm/youzan-login

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 () 登出

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published