- /draft/get API错误: 40007,错误信息:invalid media_id rid?
昨天中午和下午获取草稿API时一直报错,我的程序稳定运行了3年了,近期未做任何修改。是不是微信平台的问题??? [ 'arguments' => [ 'https://api.weixin.qq.com/cgi-bin/draft/get?access_token=63_N_pg1OWCE-YChs8qm21sv5eapb8OU46eBJYH7Fu7GRX_2w7uoGJTdtlzRZdcB6cPJc0InANFcwkShe5Vd6Ng1gVmQZdfsxf-Y1eh_BdqvIxzfQyiTvJ_juaz8oRudA-Can0qOOGpaF5CUIiTDEUaAEDYZP', '{"media_id":"aI0VcIRqR04y5A0CyY1SxK1AshOT3n-IY7yqXOzx8n-kx81CIMLrd1bZzat5tOva"}', 'post', ], 'result' => [ 'errcode' => 40007, 'errmsg' => 'invalid media_id hint: [hZr2La09680015] rid: 6391af3f-0331f2c3-0b5776a7', ], ] 群发API也报错, [ 'arguments' => [ 'https://api.weixin.qq.com/cgi-bin/draft/get?access_token=63_N_pg1OWCE-YChs8qm21sv5eapb8OU46eBJYH7Fu7GRX_2w7uoGJTdtlzRZdcB6cPJc0InANFcwkShe5Vd6Ng1gVmQZdfsxf-Y1eh_BdqvIxzfQyiTvJ_juaz8oRudA-Can0qOOGpaF5CUIiTDEUaAEDYZP', '{"media_id":"yLzJuV9q4pxuV3hKtWtxHgtD--KOmjNHEQ0iumhN0yf4tghpB9sltka3xYq1sGCh"}', 'post', ], 'result' => [ 'errcode' => 40007, 'errmsg' => 'invalid media_id hint: [bFOy0970w689] rid: 6391af42-559eb4db-70e9a38b', ], ] 麻烦帮忙看一下是什么问题,谢谢
2022-12-09 - 微信小程序 input组件 限制输入 最多10个英文或5个中文?
请问一下,微信小程序input组件怎么 限制输入 最多10个英文或5个中文 目前做法:但是setData不起作用 input框里面的值和打印出来的值不一样 getName (e) { let textLength = 0 let name= '' let nameArr = e.detail.value.split(""); nameArr.forEach((letter) => { textLength = textLength + this.validateTextLength(letter) if (textLength <= 5) { name= name+ letter } }) this.setData({ name: name }) console.log(this.data.name); }, validateTextLength (value) { // 中文、中文标点、全角字符按1长度,英文、英文符号、数字按0.5长度计算 let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/g; let mat = value.match(cnReg); let length = 0; if (mat) { length = (mat.length + (value.length - mat.length) * 0.5); return length; } else { return value.length * 0.5; } },
2020-11-18