配置存储
配置文件位置(各平台统一):
| 系统 | 路径 |
|---|---|
| Windows | C:\Users\<用户名>\.config\omnitotp\config.json |
| macOS | ~/.config/omnitotp/config.json |
| Linux | ~/.config/omnitotp/config.json |
目录名 omnitotp 由程序内置固定,首次保存时自动创建。
配置文件格式:
{
"accounts": [
{
"id": "ExampleCorp:user@example.com:JBSW",
"issuer": "ExampleCorp",
"account": "user@example.com",
"uri": "otpauth://totp/ExampleCorp:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=ExampleCorp",
"codeVisibility": "inherit",
"config": {
"secret": "JBSWY3DPEHPK3PXP",
"digits": 6,
"period": 30,
"algorithm": "SHA1"
}
}
],
"settings": {
"hideCodesOnLaunch": false
}
}
| 字段 | 说明 |
|---|---|
accounts[].codeVisibility | 该账号的验证码显示策略:inherit(跟随全局)/ hidden / visible;缺省等同 inherit |
settings.hideCodesOnLaunch | 全局开关:打开应用时是否默认隐藏验证码 |
注意
Secret 是敏感信息,请妥善保管 config.json,不要提交到公开仓库。