小程序
小游戏
企业微信
微信支付
扫描小程序码分享
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
重新编译开发者工具可以解决问题吗
本回答由AI生成,可能已过期、失效或不适用于当前情形,请谨慎参考
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。
重新编译开发者工具可以解决问题吗
({
url: ''+app.globalData.serverIP+':'+app.globalData.port+'/api/Roots/Loginpost',
method: 'POST',
header: {
'Content-Type': 'application/json' // 必须的请求头
},
data: JSON.stringify({
Username: username, // 适配后端参数命名
Password: password
}),
success: (res) => {
console.log('完整响应:', res.data);
if (res.statusCode === 200) {
// 检查服务器自定义状态码
if (res.data.code === 200 && res.data.response?.token) {
wx.setStorageSync('token', res.data.response.token);
wx.setStorageSync('userrole', res.data.response.role);
resolve(res.data);
wx.reLaunch({
url: `/pages/device/device?role=${res.data.response.role}`
});
} else {
const errorMsg = res.data?.message || '登录失败,服务器异常';
reject(new Error(errorMsg));
this.showError(errorMsg);
}
} else {
reject(new Error(`请求失败: ${res.statusCode}`));
this.showError('网络异常,请稍后重试');
}
},很简单的登入请求 ,根本也没有用到getBackgroundFetchData这些api 在4月1日 我使用3.6.6基础库 没有这个错误了 4月2日程序什么都没变 又出现这个错误了 。感觉有时候出现有时候没有。但请求什么的还能成功,但不知道运行一段时间后会不会不行,第一次出现的时候 是程序都运行了很长时间了才出现这个问题