dy-dashboard/vault/知识库/工作指南/训练记录/2026-06-26-生产环境安装dws与授权迁移.md
2026-10-28 11:14:17 +08:00

33 lines
678 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2026-06-26 生产环境安装dws CLI与钉钉授权迁移
## 背景
新电脑(生产环境)需要定时从钉钉云盘下载数据,但未安装 `dws` CLI 且未授权。
## 操作
1. 安装 dws CLI:
```
npm install -g dingtalk-workspace-cli
```
2. 从旧电脑导出授权包并导入新电脑:
```
# 旧电脑
dws auth export -o /tmp/dws-auth.tar.gz
scp /tmp/dws-auth.tar.gz dieya@192.168.11.79:/tmp/
# 新电脑
dws auth import -i /tmp/dws-auth.tar.gz
```
3. 验证授权:
```json
{"authenticated": true, "token_valid": true}
```
## 涉及工具
- `dws` CLI v1.0.41(旧电脑 v1.0.33)
- 钉钉 OAuth 授权