Code Monkey home page Code Monkey logo

ucenter's Introduction

UCenter

golang版本的ucenter接口

简介

接口文档参照UCenter接口函数

功能

  1. 用户注册
  2. 用户登录
  3. 获取用户信息
  4. 同步登陆
  5. 同步退出

使用

  1. 安装discuz
  2. 登录ucenter,添加应用
  3. 输入应用名称和其他填写参数
  4. 点击添加提交按钮,记住最后的ID

使用代码

	import (
		"github.com/fromiuan/ucenter"
		"fmt"	
	)

	const (
		url   = "http://localhost/dis/uc_server" //discuz的通讯地址(一般为http+域名+uc_server)
		appid = "3"                              //应用的id
		key   = "12345678"                       //通讯密钥
	)

	var uc *ucenter.UC
	
	func init() {
		uc = ucenter.NewUC(url, appid, key)
	}

	func main() {
		userid, err := uc.Register("username", "password", "[email protected]")
		if err != nil {
			fmt.Println(err.Error())
		}else{
			fmt.Println("user id is %d",userid)
		}
	}

ucenter's People

Stargazers

江南一根葱 avatar  avatar Lex Lim avatar  avatar  avatar 疯狂十六进制 avatar

Watchers

James Cloos avatar

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.