Giter Club home page Giter Club logo

Comments (29)

colorfbalck avatar colorfbalck commented on June 28, 2024

image

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

ip有加到上面的白名单吗

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

ip有加到上面的白名单吗

我的也是token 一直失败;ip 加到白名单了

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

ip有加到上面的白名单吗

图片
我这边显示的IP 跟你教程里面的不一致,是这个造成的吗?

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

ip有加到上面的白名单吗

图片
这种一直没有机器人回复,可能是什么原因造成的呢?

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

@ronaldinho1000 看下后台日志有没有显示结果返回, 或者有没有报错信息

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

ip加到那个白名单?

就在你截图的公众号url配置 上面

程序运行完需要在浏览器能访问url,显示以下效果
image

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

加了

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

image

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

@ronaldinho1000 看下后台日志有没有显示结果返回, 或者有没有报错信息

图片
没有什么信息返回

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

图片
验证token 时,我手动改动了一点代码,因为这里老是检查token 不匹配,所以我就直接return 了;

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

你token验证失败 怎么解决的?

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

@ronaldinho1000 看下后台日志有没有显示结果返回, 或者有没有报错信息

图片
这样配置有问题吗?

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

ip加到那个白名单?

就在你截图的公众号url配置 上面

程序运行完需要在浏览器能访问url,显示以下效果 image

这个界面我能正常显示

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

我可以正常显示,ip也加入白名单了,但是配置服务器,提示token验证失败
image
image
image
image
image

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

@colorfbalck 你服务器上有运行什么反向代理吗? 我看浏览器访问werobot页面显示端口是 443,但是实际填的是80

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

@ronaldinho1000 把 channel 的type 切到 terminal,在终端试试看openai是不是正常的

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

@colorfbalck 你服务器上有运行什么反向代理吗? 我看浏览器访问werobot页面显示端口是 443,但是实际填的是80

内网8088 代理403

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

我终端模式是正常的;可以正常使用

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

@ronaldinho1000 把 channel 的type 切到 terminal,在终端试试看openai是不是正常的

图片

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

@colorfbalck 你服务器上有运行什么反向代理吗? 我看浏览器访问werobot页面显示端口是 443,但是实际填的是80

内网8088 代理403

直接用80端口可以嘛

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

@ronaldinho1000 我晚点跑下试试

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

@colorfbalck 你服务器上有运行什么反向代理吗? 我看浏览器访问werobot页面显示端口是 443,但是实际填的是80

内网8088 代理403

直接用80端口可以嘛

外网直接用403端扣,提示系统错误。
企业微信截图_16775645238587
image

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

切换到企业公众号还是 token错误,后台一直没有收到公众号的请求呢

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

微信的token 的验证,例程中是python2 ,如果你本地用的是python3 ,你需要把代码稍微改动一下;

encoding:utf-8

filename: handle.py

import hashlib

import web

class Handle(object):

def GET(self):

    try:

        data = web.input()

        if len(data) == 0:

            return "hello, this is handle view"

        signature = data.signature

        timestamp = data.timestamp

        nonce = data.nonce

        echostr = data.echostr

        token = "123456" #请按照公众平台官网\基本配置中信息填写



        list = [token, timestamp, nonce]

        list.sort()

        sha1 = hashlib.sha1()

        sha1.update(list[0].encode('utf-8'))

        sha1.update(list[1].encode('utf-8'))

        sha1.update(list[2].encode('utf-8'))

        hashcode = sha1.hexdigest()

        print( "handle/GET func: hashcode, signature: ", hashcode, signature)

       # return echostr

        if hashcode == signature:

            return echostr

        else:

            return ""

    except Exception as Argument:

        return Argument

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

微信的token 的验证,例程中是python2 ,如果你本地用的是python3 ,你需要把代码稍微改动一下;

encoding:utf-8

filename: handle.py

import hashlib

import web

class Handle(object):

def GET(self):

    try:

        data = web.input()

        if len(data) == 0:

            return "hello, this is handle view"

        signature = data.signature

        timestamp = data.timestamp

        nonce = data.nonce

        echostr = data.echostr

        token = "123456" #请按照公众平台官网\基本配置中信息填写



        list = [token, timestamp, nonce]

        list.sort()

        sha1 = hashlib.sha1()

        sha1.update(list[0].encode('utf-8'))

        sha1.update(list[1].encode('utf-8'))

        sha1.update(list[2].encode('utf-8'))

        hashcode = sha1.hexdigest()

        print( "handle/GET func: hashcode, signature: ", hashcode, signature)

       # return echostr

        if hashcode == signature:

            return echostr

        else:

            return ""

    except Exception as Argument:

        return Argument

这修改的是那个文件 没有handle.py呢

from bot-on-anything.

colorfbalck avatar colorfbalck commented on June 28, 2024

用的python3.10

from bot-on-anything.

ronaldinho1000 avatar ronaldinho1000 commented on June 28, 2024

你要按照腾讯给的一些例子进行设置一下才行;

from bot-on-anything.

zhayujie avatar zhayujie commented on June 28, 2024

正常情况部署上去就自带token验证的,不需要增加代码的,看下是不是路由配置的问题

from bot-on-anything.

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.