提交 bb7937ae 编写于 作者: J Jason

使用 github.com/denisbrodbeck/machineid 获取机器码

上级 721a20c3
package main
import (
"github.com/denisbrodbeck/machineid"
"github.com/zgwit/dtu-admin/conf"
"github.com/zgwit/dtu-admin/db"
"github.com/zgwit/dtu-admin/dtu"
......@@ -31,7 +32,14 @@ func main() {
//加载配置
conf.Load()
err := db.Open()
id, err := machineid.ID()
if err != nil {
log.Println("ID错误:", err)
return
}
log.Println("Machine ID:", id)
err = db.Open()
if err != nil {
log.Println("数据库错误:", err)
return
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册