foyoux / aligo

🔥简单、易用、可扩展的阿里云盘 API 接口库🚀
GNU General Public License v3.0
849 stars 156 forks source link

问题周末统一处理,平时时间太零碎 #81

Closed lemisky closed 1 year ago

lemisky commented 1 year ago

mmexport1676292316652.png

mmexport1676292316907.jpg

lemisky commented 1 year ago

图片来自群友

lemisky commented 1 year ago

x-device-id 任意,唯一即可

web 端来源 https://log.mmstat.com/eg.js 此信息来自交流群群友

原理:根据浏览器请求携带的信息(一些 header 啥的)生成一个 etag(x-device-id)

移动端 是同 device-id 进行 sha256 取得

aligo 暂时采用 device-id sha256 方式

lemisky commented 1 year ago

群友提供的信息

https://www.52pojie.cn/thread-1745677-1-1.html

lemisky commented 1 year ago

x-device-id 任意,唯一即可

web 端来源 https://log.mmstat.com/eg.js 此信息来自交流群群友

原理:根据浏览器请求携带的信息(一些 header 啥的)生成一个 etag(x-device-id)

移动端 是同 device-id 进行 sha256 取得

aligo 暂时采用 device-id sha256 方式

aligo 获取的 device-id 与扫码的移动端设备 id 一致,如果在多个地方登录,device-id 也是一样的,这样势必产生干扰,

暂定用随机 uuid 吧

lemisky commented 1 year ago

x-signature 生成流程

  1. 生成 private_key
  2. 利用 private_key 得到 public_key, 之后携带 public_key 发送 create_session 请求,服务器记录 x-device-id 和 public_key, x-device-id 用作退出登录使用,public_key 用于 校验 x-signature 的真实性
  3. 之后的 x-signature 包含 app_id device-id userid, 这里的 device-id 是 x-device-id

r = "".concat(this.config.appId, ":").concat(this.config.deviceId, ":").concat(this.config.userId, ":").concat(n),