1. 修复联系人搜索显示异常的问题

2. 修复启动时界面加载显示慢的问题
This commit is contained in:
HAL 2024-11-11 21:50:13 +08:00
parent 331cd8125d
commit cdc1f6a0d7
5 changed files with 522 additions and 12 deletions

22
app.go
View File

@ -21,7 +21,7 @@ const (
configDefaultUserKey = "userConfig.defaultUser" configDefaultUserKey = "userConfig.defaultUser"
configUsersKey = "userConfig.users" configUsersKey = "userConfig.users"
configExportPathKey = "exportPath" configExportPathKey = "exportPath"
appVersion = "v1.0.4" appVersion = "v1.0.5"
) )
type FileLoader struct { type FileLoader struct {
@ -59,8 +59,8 @@ type App struct {
defaultUser string defaultUser string
users []string users []string
firstStart bool firstStart bool
firstInit bool
FLoader *FileLoader FLoader *FileLoader
} }
type WeChatInfo struct { type WeChatInfo struct {
@ -91,6 +91,7 @@ type ErrorMessage struct {
func NewApp() *App { func NewApp() *App {
a := &App{} a := &App{}
a.firstInit = true
a.FLoader = NewFileLoader(".\\") a.FLoader = NewFileLoader(".\\")
viper.SetConfigName(defaultConfig) viper.SetConfigName(defaultConfig)
viper.SetConfigType("json") viper.SetConfigType("json")
@ -103,14 +104,8 @@ func NewApp() *App {
log.Println("SetFilePrefix", prefix) log.Println("SetFilePrefix", prefix)
a.FLoader.SetFilePrefix(prefix) a.FLoader.SetFilePrefix(prefix)
} }
a.scanAccountByPath(prefix)
// log.Println(a.defaultUser)
// log.Println(a.users)
} else { } else {
if a.scanAccountByPath(".\\") != nil { log.Println("not config exist")
log.Println("not config exist")
}
} }
log.Printf("default: %s users: %v\n", a.defaultUser, a.users) log.Printf("default: %s users: %v\n", a.defaultUser, a.users)
if len(a.users) == 0 { if len(a.users) == 0 {
@ -257,6 +252,13 @@ func (a *App) createWechatDataProvider(resPath string, prefix string) error {
} }
func (a *App) WeChatInit() { func (a *App) WeChatInit() {
if a.firstInit {
a.firstInit = false
a.scanAccountByPath(a.FLoader.FilePrefix)
log.Println("scanAccountByPath:", a.FLoader.FilePrefix)
}
if len(a.defaultUser) == 0 { if len(a.defaultUser) == 0 {
log.Println("not defaultUser") log.Println("not defaultUser")
return return

View File

@ -1,3 +1,7 @@
## v1.0.5
1. 修复联系人搜索显示异常的问题
2. 修复启动时界面加载显示慢的问题
## v1.0.4 ## v1.0.4
1. 优化头像显示,优先使用本地头像显示 1. 优化头像显示,优先使用本地头像显示
2. 支持自定义导出路径、增加对导出路径的权限检测 2. 支持自定义导出路径、增加对导出路径的权限检测

503
frontend/dist/assets/index.5130ac24.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,8 @@
<meta charset="UTF-8"/> <meta charset="UTF-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/> <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>wechatDataBackup</title> <title>wechatDataBackup</title>
<script type="module" crossorigin src="/assets/index.e451d83d.js"></script> <script type="module" crossorigin src="/assets/index.5130ac24.js"></script>
<link rel="stylesheet" href="/assets/index.bee21395.css"> <link rel="stylesheet" href="/assets/index.f70722f4.css">
</head> </head>
<body > <body >
<div id="root"></div> <div id="root"></div>