fix encryptMobile

This commit is contained in:
liangzai 2025-04-09 22:44:36 +08:00
parent f630c515e7
commit 735599db6d
2 changed files with 4 additions and 3 deletions

View File

@ -54,7 +54,9 @@ func main() {
} }
fmt.Println("异步任务启动!!!") fmt.Println("异步任务启动!!!")
}() }()
go func() {
script.RunEncryptMobile()
}()
server := rest.MustNewServer(c.RestConf) server := rest.MustNewServer(c.RestConf)
defer server.Stop() defer server.Stop()
@ -62,6 +64,4 @@ func main() {
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port) fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
server.Start() server.Start()
script.RunEncryptMobile()
} }

View File

@ -21,6 +21,7 @@ const (
) )
func RunEncryptMobile() { func RunEncryptMobile() {
fmt.Println("开始加密手机号")
// 连接数据库 // 连接数据库
dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", dsn := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8mb4&parseTime=True&loc=Local",
dbUser, dbPassword, dbHost, dbPort, dbName) dbUser, dbPassword, dbHost, dbPort, dbName)