Browse Source

:sparkles: 支持设置 `config.FALLBACK_LOCAL_NUMBER` 作为回退本机号码

Mizore 1 year ago
parent
commit
cba87e9b6f
2 changed files with 4 additions and 1 deletions
  1. 3 0
      script/config.lua
  2. 1 1
      script/util_notify.lua

+ 3 - 0
script/config.lua

@@ -85,4 +85,7 @@ return {
     --
     -- 开启低功耗模式, USB 断开连接无法查看日志, RNDIS 网卡会断开
     LOW_POWER_MODE = false,
+    --
+    -- 本机号码, 优先使用 mobile.number() 接口获取, 如果获取不到则使用此号码
+    FALLBACK_LOCAL_NUMBER = "+8618888888888",
 }

+ 1 - 1
script/util_notify.lua

@@ -292,7 +292,7 @@ local function append()
     local msg = "\n"
 
     -- 本机号码
-    local number = mobile.number(mobile.simid())
+    local number = mobile.number(mobile.simid()) or config.FALLBACK_LOCAL_NUMBER
     if number then msg = msg .. "\n本机号码: " .. number end
 
     -- 开机时长