看过我WPF 微信 MVVM这篇文章的朋友,应该知道我里面提到了我有一个小号是无法获取列表的,始终也没找到原因。

前两天经过GitHub上h4dex大神的指导,知道了原因,是因为微信在登录以后,web微信采取了不同的域名来兼容各种用户。

下面是大神提供的js代码和C#代码

function ()
{
    var e = location.host,
    t = 'weixin.qq.com',
    o = 'file.wx.qq.com',
    n = 'webpush.weixin.qq.com';
    e.indexOf('wx2.qq.com') >  - 1 ? (t = 'weixin.qq.com', o = 'file2.wx.qq.com', n = 'webpush2.weixin.qq.com')
     : e.indexOf('qq.com') >  - 1 ? (t = 'weixin.qq.com', o = 'file.wx.qq.com', n = 'webpush.weixin.qq.com')
     : e.indexOf('web1.wechat.com') >  - 1 ? (t = 'wechat.com', o = 'file1.wechat.com', n = 'webpush1.wechat.com')
     : e.indexOf('web2.wechat.com') >  - 1 ? (t = 'wechat.com', o = 'file2.wechat.com', n = 'webpush2.wechat.com')
     : e.indexOf('wechat.com') >  - 1 ? (t = 'wechat.com', o = 'file.wechat.com', n = 'webpush.wechat.com')
     : e.indexOf('web1.wechatapp.com') >  - 1 ? (t = 'wechatapp.com', o = 'file1.wechatapp.com', n = 'webpush1.wechatapp.com')
    : (t = 'wechatapp.com', o = 'file.wechatapp.com', n = 'webpush.wechatapp.com');
}
js

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2021-06-02
  • 2021-07-10
  • 2021-11-22
  • 2021-07-20
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-11
  • 2022-01-18
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案