Giter Club home page Giter Club logo

Comments (1)

royalrick avatar royalrick commented on May 12, 2024
coder := code.QRCoder{
			Scene:     "123",                // 参数数据
			Page:      "pages/moments/main", // 识别二维码后进入小程序的页面链接
			Width:     280,                  // 图片宽度
			IsHyaline: true,                 // 是否需要透明底色
			AutoColor: false,                // 自动配置线条颜色, 如果颜色依然是黑色, 则说明不建议配置主色调
			LineColor: code.Color{ //  AutoColor 为 false 时生效, 使用 rgb 设置颜色 十进制表示
				R: "50",
				G: "50",
				// B: "50",
			},
		}
		res, err := coder.UnlimitedAppCode(your_token)
		if err != nil {
			//
		}
		defer res.Body.Close()

		bytes, err := ioutil.ReadAll(res.Body)
		if err != nil {
			return
		}
		f, err := os.Create("code.jpeg")
		if err != nil {
			return
		}
		defer f.Close()

		f.Write(bytes)

参考下

from weapp.

Related Issues (20)

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.