服务端免鉴权,关客户端啥事
云托管的小程序如何获取openid 或unionid?请问小程序端如何获取自己的openid 或unionid? 针对需对是,每个小程序用户会生成自己的图片,图片会上传到云托管的对象存储,这些图片允许自己访问,需要用一个ID(openid 或 unionid)作为文件夹名, 难道我得服务端写一个接口专门返回这个openid ? (openid是在服务端header 头里才有) 我试了wx.login 它只给我返回一个code, 我都用了云托管了,为什么还返回一个code,不是免鉴权了,不应该直接返回相关信息吗?
2024-09-23不支持服务器?
在服务器上调jscode2session 报40029,而小程序连我本地的服务正常?小程序 连本地的服务,小程序正常登陆。 而把同样的服务端代码部署到服务器,小程序仅切换了域名地址url,则出现{"errcode":40029,"errmsg":"invalid code, rid: 66efe236-59b811e4-06ed8151"} 。 【请求参数】:【请求参数】:js_code=0a1RZq0005iURS1moe1006MGSg2RZq05&secret=******&grant_type=authorization_code&appid=******** 可以确保jscode没有多次使用,而且尝试过多次使用时是出现不同的错误code。 小程序请求参数 [图片]
2024-09-22我本地ping不通,超时啊,咋解释
云函数调用接口提示超时 connect ETIMEDOUT 154.92.16.97:443const response = await axios({ method: 'post', url:'https://api.openai.com/v1/chat/completions', headers: { 'Content-Type': 'application/json', 'Authorization': OPENAI_API_KEY1, }, data: { model: 'gpt-4', messages: [{ role: 'user', content: prompt }], stream: true }, responseType: 'stream', }); [图片] postman可以调到,云函数提示超时
2024-09-22接口还需要登录啊
小程序在手机端无法访问服务器接口,微信开发者工具,安卓端可以访问,是什么原因?发布的微信小程序体验版本,使用小程序上的功能需要请求服务器接口,请求成功,但是接口返回的是错误的信息{"data":"Internal Server Error","profile":{"transportRttEstimate":45,"domainLookUpStart":1726975926905,"responseEnd":1726975927882,"sendBytesCount":1215,"redirectStart":0,"connectEnd":1726975927011,"protocol":"http/1.1","peerIP":"60.171.194.72","requestStart":1726975926905,"socketReused":false,"fetchStart":1726975926905,"SSLconnectionStart":1726975926957,"estimate_nettype":5,"httpRttEstimate":54,"throughputKbps":0,"SSLconnectionEnd":1726975927011,"downstreamThroughputKbpsEstimate":1961,"domainLookUpEnd":1726975926912,"responseStart":1726975927879,"redirectEnd":0,"rtt":44,"connectStart":1726975926912,"port":41856,"receivedBytedCount":196,"requestEnd":1726975927882,"usingHighPerformanceMode":false},"header":{"Server":"nginx","Connection":"keep-alive","Content-Length":"21","Date":"Sun, 22 Sep 2024 03:27:21 GMT","Content-Type":"text/plain; charset=utf-8"},"statusCode":500,"cookies":[],"accelerateType":"none","errMsg":"request:ok"}。小程序运行在微信开发者工具时,接口返回的是正确的信息,我改怎么解决这个问题呢?request域名已经把接口域名加上了,还是不能解决这个问题,很奇怪为什么会出现这种情况,我还需要做些什么才能解决这个问题呢?
2024-09-22chat4有啥用,还不是人去回答。去云开发控制台运行,没问题测试通过再说代码
在选课页面中选课时应该调用云函数,云函数的作用是给课程数量减1,但是运行时并没用,如何排查?//调用云函数课程数量减1 wx.cloud.callFunction({ name:"minusCourseNum", data:{ courseName:courseName } }).then(res=>{ wx.showToast({ title: '选课成功', }) }) this.data.disable = true //云函数 // 云函数入口文件 import { init, database } from 'wx-server-sdk' init() const db = database() console.log('Database connection:',db) const _ = db.command // 云函数入口函数 export async function main(event,context) { const courseCollection = db.collection("course") return await courseCollection.where({ courseName:event.courseName }).updata({ data:{ num:_.inc(-1) } }) }
2024-09-21postman也没响应?
公众号开发-生成带参数的二维码请求接口无任何响应?https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=token 之前一直用的sdk,今天突然生成不了图片,然后自己参照接口文档单独写了个请求方法,结果还是不行,接口完全没有响应 ↓↓↓C#代码片段↓↓↓ [图片]
2024-09-20公众号
小程序中webview引入JSSDK,使用的appid是小程序的appid还是公众号的appid?小程序中webview引入JSSDK,使用的appid是小程序的appid还是公众号的appid?
2024-09-19postman调通了再谈代码吧
小程序调用onenet物联网平台数据data为null?// 事件处理 getinfo(){ var that = this//当前对象 const authInfo = "version=2022-05-01&res=userid%2F341108&et=1733816371&methodign=%2BVNoDSm%2BgKOork6IMDt4ZfaSrag%3D"; wx.request({ url: "https://iot-api.heclouds.com/thingmodel/query-device-property?product_id=6M1COeLZek&device_name=weather", // 设备id header:{ // "api-key":"h4vjQQ+5q+lT288drZ8VZbETt2117eeFtcsZJ6NFs3c=" "api-key":"OHVMdDk0V1JraVZNQTVXME9GMGpsYlNsYjFSdGNXUU0=", 'Authorization':authInfo }, method:"GET", success:function(e){ console.log("获取成功",e) } }) }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { var that = this that.getinfo() },
2024-09-19让用户手输啊
关于手机授权问题?[图片] 请问点了手机授权,不拿手机号那要如何鉴权是不是员工; 如果我都知道是员工了,我还要手机号来干嘛; 能否重新组织下语言告知一下?
2024-09-19[图片]
9.15 05:51 failed to respond的原因是什么?09-15 05:51:36,969 ERROR [http-nio-8080-exec-3][com.huawei.dpcloud.mpwechat.infrastructure.api.wx.client.QrCodeService 68] get qrcode error {} 1 org.springframework.web.client.ResourceAccessException: I/O error on POST request for "https://api.weixin.qq.com/cgi-bin/qrcode/create": api.weixin.qq.com:443 failed to respond; nested exception is org.apache.http.NoHttpResponseException: api.weixin.qq.com:443 failed to respond
2024-09-17