wxlogin
This commit is contained in:
@@ -2,6 +2,8 @@ package weixin
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
"git.rosy.net.cn/baseapi/platformapi/weixinapi"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2"
|
"git.rosy.net.cn/jx-callback/business/auth2"
|
||||||
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
"git.rosy.net.cn/jx-callback/business/auth2/authprovider"
|
||||||
@@ -68,18 +70,8 @@ func (a *Auther) VerifySecret(id, secret string) (authBindEx *auth2.AuthBindEx,
|
|||||||
state := id
|
state := id
|
||||||
code := jsCode
|
code := jsCode
|
||||||
if state == "" {
|
if state == "" {
|
||||||
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
temp := a.getAPI()
|
||||||
if err = err2; err == nil {
|
fmt.Printf("secret=%s,appid=%s", temp.GetSecret(), temp.GetAppID())
|
||||||
openID = token.OpenID
|
|
||||||
accessToken = token.AccessToken
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
err = ErrStateIsWrong
|
|
||||||
}
|
|
||||||
} else if a.authType == AuthTypeWxApp {
|
|
||||||
state := id
|
|
||||||
code := jsCode
|
|
||||||
if state == "" {
|
|
||||||
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
token, err2 := a.getAPI().SNSRetrieveToken(code)
|
||||||
if err = err2; err == nil {
|
if err = err2; err == nil {
|
||||||
openID = token.OpenID
|
openID = token.OpenID
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ func getActStoreSkuFromTaskResult(taskReslt []interface{}) (list []*model.ActSto
|
|||||||
|
|
||||||
func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (createdList []*model.ActStoreSku2, err error) {
|
func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (createdList []*model.ActStoreSku2, err error) {
|
||||||
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
||||||
task := tasksch.NewParallelTask("mtwm createSkuAct", nil, ctx,
|
task := tasksch.NewParallelTask("txd createSkuAct", nil, ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
list := batchItemList[0].([]*model.ActStoreSku2)
|
list := batchItemList[0].([]*model.ActStoreSku2)
|
||||||
failedList, err2 := createOneShopAct(act, list[0].VendorStoreID, list)
|
failedList, err2 := createOneShopAct(act, list[0].VendorStoreID, list)
|
||||||
@@ -285,7 +285,7 @@ func createSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.A
|
|||||||
|
|
||||||
func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (canceledList []*model.ActStoreSku2, err error) {
|
func cancelSkuAct(ctx *jxcontext.Context, parentTask tasksch.ITask, act *model.Act2, actStoreSku []*model.ActStoreSku2) (canceledList []*model.ActStoreSku2, err error) {
|
||||||
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
actStoreSkuListList := partner.SplitActStoreSku2List(actStoreSku)
|
||||||
task := tasksch.NewParallelTask("mtwm cancelSkuAct", nil, ctx,
|
task := tasksch.NewParallelTask("txd cancelSkuAct", nil, ctx,
|
||||||
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
func(task *tasksch.ParallelTask, batchItemList []interface{}, params ...interface{}) (retVal interface{}, err error) {
|
||||||
actStoreSkuList := batchItemList[0].([]*model.ActStoreSku2)
|
actStoreSkuList := batchItemList[0].([]*model.ActStoreSku2)
|
||||||
if _, err = cancelOneShopAct(act, actStoreSkuList[0].VendorStoreID, actStoreSkuList); err == nil {
|
if _, err = cancelOneShopAct(act, actStoreSkuList[0].VendorStoreID, actStoreSkuList); err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user