首先在个人修改头像的地方F12看看接口地址:
然后在控制台执行下面的代码:
var ajax = new XMLHttpRequest(); //https://juejin.cn/user/update/upload_avatar ajax.open('post','https://juejin.cn/web/user/update/user_info/',true); ajax.setRequestHeader('content-type','application/x-www-form-urlencoded'); ajax.send("aid=2608&avatar=https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/de3777c5cf90498d8d604b79f0e98c76~tplv-k3u1fbpfcp-watermark.image?"); ajax.onreadystatechange = function (){ if(ajax.readyState==4&&ajax.status==200){ var c = ajax.responseText; console.log(c) } }
备注:
aid=2608&avatar=https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/de3777c5cf90498d8d604b79f0e98c76~tplv-k3u1fbpfcp-watermark.image?
这是自己的aid和avatar头像地址(头像地址可以在编写文章的时候上传一张gif,然后复制地址即可)
回车就行了(下面这样返回成功提示)