npm.io
1.3.22 • Published 6 years ago

midu-superid-plugin

Licence
—
Version
1.3.22
Deps
0
Size
49 kB
Vulns
0
Weekly
0

midu-superid-plugin

Install

npm i -S midu-superid-plugin

Import Plugin

import SuperID from 'midu-superid-plugin'
// or
const SuperID = require('midu-superid-plugin')

Use Plugin

import SuperID from 'midu-superid-plugin'

const appID = 'Your Midu Chrome Extentions Appid'

const superid = await SuperID.connect(appID)
if (!superid) {
  return console.error('no Midu Chrome Extensions')
}

//  login Midu Extentions
const user = await superid.login()
//   returns user info
console.log(user)

Plugin Api

login 插件登陆

  • parameters (object)
    channelId: 登陆的路径(企业邮箱,链空间等等) default: 1

  • returns
    用户信息包括 Session

  • examples

 //  login Midu Extentions
const user = await superid.login()
//   returns user info
console.log(user)

settingSuperID 设置Superid

  • parameters (object)
    superId: 用户设置的superid (必填)

  • returns
    成功信息

  • examples

superid.settingSuperID({ superId: 123 })

purchaseSuperID 购买超级用户名

  • parameters (object)
    loginName: 用户需要购买的超级用户名 (必填)
    currentPrice: 该用户名的价格 (必填)

  • returns
    成功信息

  • examples

superid.purchaseSuperID({
    loginName: 'midu888',
    currentPrice: '1000'
})

getPayOrderId 获取订单编号

  • parameters (object)
    orderId: 支付 时发送的成功是返回的订单id (必填)

  • returns
    成功信息

  • examples

superid.getPayOrderId({
    orderId: '121345622551222'
})

updating...