Giter VIP home page Giter VIP logo

weixin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

weixin's Issues

发送模板消息出现 `json: cannot unmarshal number into Go struct field .msgid of type int32` 错误

完整信息 json: cannot unmarshal number 445263598701395969 into Go struct field .msgid of type int32

weixin/weixin.go

Lines 763 to 768 in e9f0f20

var resp struct {
MsgID int64 `json:"msgid,omitempty"`
}
if err := json.Unmarshal(reply, &resp); err != nil {
return 0, err
}

原因在于int32 不能包含 445263598701395969 ,它也比较解决 int64 的最大值

https://golang.org/pkg/encoding/json/#Number 可能是最后的解决方案

Create QR code

Method: Post
URL: https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=TOKEN

QR Scene Body:

{
    "expire_seconds": 1800,
    "action_name": "QR_SCENE",
    "action_info": {
        "scene": {
            "scene_id": 123
        }
    }
}

PS. scene_id max 100000

QR Limit Scene Body:

{
    "action_name": "QR_LIMIT_SCENE",
    "action_info": {
        "scene": {
            "scene_id": 123
        }
    }
}

PS. scene_id max 1000

Result:

{
    "ticket":"<QR Code Ticket>",
    "expire_seconds":1800
}

Can't create menu when using openauth url with "&"

Json lib will encoding the "&" to \u0026 , so if you want to create openauth url like:
https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=SCOPE&state=STATE#wechat_redirect
That will cause the CreateMenu fail.

The related code:
https://github.com/wizjin/weixin/blob/master/weixin.go#L418

I've got quick-and-dirty patch by repalce it to "&"
https://github.com/imzjy/weixin/blob/master/weixin.go#L391

Maybe there is good way to fix it, just hightlight the issue here.

Button type

// Button type
MenuButtonTypeKey = "click"
MenuButtonTypeUrl = "view"

    这个是不是应该是
MenuButtonTypeKey = "CLICK"
MenuButtonTypeUrl = "VIEW"

downloadMedia

多媒体文件下载的时候 Content-Type: text/plain以外的情况下:
只返回r.Body(其他类型的处理好像也都是只返回r.Body).
同样的是多媒体类型之图片的时候,没法判断获取的内容是什么类型的文件.
比如jpg/png就无法区分,但是又要在开始的时候创建文件.

Token的存储和共享问题

在集群环境下,Token是需要进行集中化管理的,而现在的这种模式,我觉得做集中化管理比较困难把~能不能有办法解决呢?

create jsApi error

noncestr := fmt.Sprintf("%d", c.randreader.Int())
what is the point of the above sentence?

不成功!

mux := weixin.New("tk_wx_xxx", "", "")
mux.HandleFunc(weixin.MsgTypeText, Echo)
http.Handle("/wx/signature", mux)

func Echo(w weixin.ResponseWriter, r *weixin.Request) {
txt := r.Content // 获取用户发送的消息
w.ReplyText(txt) // 回复一条文本消息
w.PostText("Post:" + txt) // 发送一条文本消息
}

我的这个地址 会报404错误

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.