Giter Site home page Giter Site logo

union's Introduction

union

union login component developed by go. support Alipay, WeChat, QQ, Weibo, UmsPay, Mini Program, Wxwork

alipay

package main

import (
	"fmt"

	"github.com/tiantour/union/mi"
)

func main() {
    mi.AppID = "your AppID"
    mi.PrivatePath = "your PrivateKey path"
    mi.PublicPath = "your PublicKey path"
	user, err := mi.NewMI().User("your code", "your content")
	fmt.Println(user, err)
}

wechat

package main

import (
	"fmt"

	"github.com/tiantour/union/wechat"
)

func main() {
    wechat.AppID = "your AppID"
    wechat.AppSecret = "your AppSecret"
	user, err := wechat.NewWechat().User("your code")
	fmt.Println(user, err)
}

qq

package main

import (
	"fmt"

	"github.com/tiantour/union/qq"
)

func main() {
    qq.AppID = "your AppID"
	user, err := qq.NewQQ().User("your AccessToken", "your OpenID")
	fmt.Println(user, err)
}

weibo

package main

import (
	"fmt"

	"github.com/tiantour/union/weibo"
)

func main() {
    weibo.AppID = "your AppID"
	user, err := weibo.NewWeibo().User("your accessToken", "your UID")
	fmt.Println(user, err)
}

umsPay

package main

import (
	"fmt"

	"github.com/tiantour/union/ums"
)

func main() {
    ums.AppID = "your AppID"
    ums.AppKey = "your AppKey"
	user, err := ums.NewToken().Access()
	fmt.Println(user, err)
}

mini program

package main

import (
	"fmt"

	"github.com/tiantour/union/mp"
)

func main() {
    mp.AppID = "your AppID"
    mp.AppSecret = "your AppSecret"

    // new 
	data, err := mp.NewSession().Get("your code")
	fmt.Println(data, err)

    // old
    data, err := mp.NewMP().User(encryptedData, iv)
	fmt.Println(data, err)

}

wxwork

package main

import (
	"fmt"

	"github.com/tiantour/union/wxwork"
)

func main() {
    wxwork.CorpID = "your CorpID"
    wxwork.CorpSecret = "your CorpSecret" 
	user, err := mp.NewWxwork().User(code)
	fmt.Println(user, err)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.