自动化获取小米账号的 passToken 并保存到本地文件。
.gitignore
package.json
readme.md
token.txt
src/
src/index.js
src/io.js
-
安装依赖:
yarn install
-
设置环境变量:
export MI_USER=你的手机号 export MI_PASS=你的密码
-
运行脚本:
yarn dev
或者直接运行:
node src/index.js
-
登录后,
passToken会自动保存到token.txt文件。
你可以通过 Docker 快速运行本项目。请将 你的手机号 和 你的密码 替换为你自己的小米账号信息。
docker run -d \
--name mi-token \
--restart=always \
-e MI_USER=你的手机号 \
-e MI_PASS=你的密码 \
-v /mnt/sda3/mi_account/token.txt:/usr/src/work_dir/auto_record_mi_token/token.txt \
zsj439453290/record_mi_passtoken:1.0.0-linux-amd64docker exec -it mi-token /bin/sh
$ yarn // when you first run it ,you need install dependencies
$ npm run dev // exec script mount token.txt注意:请勿将账号和密码明文暴露在公共环境中。
- 请勿将
token.txt文件上传到公共仓库。 - 登录过程需要人工辅助完成验证码等操作。
Automatically obtain Xiaomi account passToken and save it to a local file.
.gitignore
package.json
readme.md
token.txt
src/
src/index.js
src/io.js
-
Install dependencies:
yarn install
-
Set environment variables:
export MI_USER=your_phone_number export MI_PASS=your_password
-
Run the script:
yarn dev
Or run directly:
node src/index.js
-
After login,
passTokenwill be automatically saved to thetoken.txtfile.
You can quickly run this project using Docker. Please replace your_phone_number and your_password with your own Xiaomi account information.
docker run -d \
--name mi-token \
--restart=always \
-e MI_USER=your_phone_number \
-e MI_PASS=your_password \
-v /mnt/sda3/mi_account/token.txt:/usr/src/work_dir/auto_record_mi_token/token.txt \
zsj439453290/record_mi_passtoken:1.0.0-linux-amd64docker exec -it mi-token /bin/sh
$ yarn # When you first run it, you need to install dependencies
$ npm run dev # Execute script and mount token.txtNote: Do not expose your account and password in public environments.
- Do not upload the
token.txtfile to public repositories. - The login process may require manual assistance to complete captcha and other operations.