"{"errcode":41008,"errmsg":"missing code, hints: [ req_id: ginCi5yFe-.rOgNA ]"}" 上面这是后台返回给前台的这是怎末回事?求各位大神详解!!! 下面是后台代码 用的vs2013和c#
public void GetCode(string code)
{
string serviceAddress =
"https://api.weixin.qq.com/sns/jscode2session?appid=我的&secret=我的"
+ "&js_code=" + code + "&grant_type=authorization_code";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceAddress);
request.Method = "GET";
request.ContentType = "text/html;charset=utf-8";
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream myResponseStream = response.GetResponseStream();
StreamReader myStreamReader = new StreamReader(myResponseStream, System.Text.Encoding.UTF8);
string retString = myStreamReader.ReadToEnd();
myStreamReader.Close();
myResponseStream.Close();
var obj = new
{
data = retString,
Success = true
};
Formatting microsoftDataFormatSetting = default(Formatting);
string result = JsonConvert.SerializeObject(obj, microsoftDataFormatSetting);
HttpContext.Current.Response.Write(result);
}
也遇到这个问题了怎么办
登录时候,后台返给你了吗
就是登陆的时候去获取openid 请求了后端然后给前端返回了{"errcode":41008,"errmsg":"missing code, hints: [ req_id: ginCi5yFe-.rOgNA ]"}这个啊
这个openId你不用管,这个后台给你的,报错要他那头处理,你只要能拿到就行
后台也是我写的
好吧