-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:新增JS-SDK使用权限签名 #796
base: v2
Are you sure you want to change the base?
feat:新增JS-SDK使用权限签名 #796
Conversation
# Conflicts: # work/externalcontact/client.go # work/oauth/oauth.go # work/work.go
# Conflicts: # work/externalcontact/user.go
# Conflicts: # work/message/client.go # work/message/message.go # work/oauth/oauth.go # work/work.go
func (js *Js) GetAgentConfig(uri string) (config *Config, err error) { | ||
config = new(Config) | ||
var accessToken string | ||
accessToken, err = js.GetAccessToken() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
73,74合并处理,下面的78,79也是一样,以及83-86 是不是可以合并定义呢?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢
// GetAgentConfig 获取jssdk需要的配置参数 | ||
// uri 为当前网页地址 | ||
func (js *Js) GetAgentConfig(uri string) (config *Config, err error) { | ||
config = new(Config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
建议 Config
对象在使用时在创建,如在88行之前创建。GetConfig
方法也是同样建议
feat:新增企业微信消息推送接收和发送
# Conflicts: # credential/work_js_ticket.go # work/js/js.go # work/message/reply.go # work/server/error.go # work/server/server.go # work/server/util.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix golangci-lint action prompt @hb1707 ,thanks
Release 2.0 hb
Merge pull request #3 from hb1707/v2
"github.com/silenceper/wechat/v2/miniprogram/context" | ||
"strings" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里strings
应该紧跟在fmt
后面,以及第10行的空格不要删除
@@ -16,3 +17,16 @@ func Signature(params ...string) string { | |||
} | |||
return fmt.Sprintf("%x", h.Sum(nil)) | |||
} | |||
|
|||
func CalSignature(params ...string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
公共方法需要有注释说明
import ( | ||
"encoding/json" | ||
"fmt" | ||
"github.com/silenceper/wechat/v2/util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import是按组引入,比如系统包一组,第三方一组,自己的一组,中间用空行分隔
Signature string `json:"signature"` | ||
} | ||
|
||
//NewJs init |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释标准是 //
斜杠后面加一个空格之后,再添加方法名称 以及在具体说明
import ( | ||
"encoding/json" | ||
"fmt" | ||
"github.com/silenceper/wechat/v2/util" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
按组引入
"github.com/silenceper/wechat/v2/work/context" | ||
"github.com/silenceper/wechat/v2/work/message" | ||
log "github.com/sirupsen/logrus" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个15空行
建议删除
https://developer.work.weixin.qq.com/document/path/90506