Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tech
pi_sys
Commits
6682c33c
Commit
6682c33c
authored
1 year ago
by
余强
Browse files
Options
Download
Email Patches
Plain Diff
fix: 修复拷贝文件源信息解析失败导致游戏无法进入BUG
parent
55cf1a4c
ydzm_multi_version
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pi_sys/setup/main.ts
+3
-1
src/pi_sys/setup/main.ts
src/pi_sys/update/assets_to_data.ts
+15
-6
src/pi_sys/update/assets_to_data.ts
with
18 additions
and
7 deletions
+18
-7
src/pi_sys/setup/main.ts
+
3
-
1
View file @
6682c33c
...
...
@@ -80,7 +80,9 @@ export const main = (cfg: any, depend: any): Promise<boolean> => {
Native
.
App
.
getVersionCode
(),
Native
.
App
.
getFlavorName
(),
Native
.
App
.
getApiVersion
(),
initDataCopy
()
initDataCopy
().
catch
(
e
=>
{
logger
.
error
(
"
initDataCopy Error
"
,
formatError
(
e
));
})
];
return
Promise
.
all
(
ps
).
then
((
result
)
=>
{
...
...
This diff is collapsed.
Click to expand it.
src/pi_sys/update/assets_to_data.ts
+
15
-
6
View file @
6682c33c
...
...
@@ -5,11 +5,14 @@
import
{
readFromLocal
}
from
"
pi_sys/load/data_transfer
"
;
import
{
Asset
}
from
"
pi_sys/store/asset
"
;
import
{
access
,
readFile
,
writeFile
}
from
"
pi_sys/store/file_system
"
;
import
{
access
,
readFile
,
unlink
,
writeFile
}
from
"
pi_sys/store/file_system
"
;
import
{
Depend
}
from
"
pi_sys/util/depend
"
;
import
{
Env
}
from
"
pi_sys/util/env
"
import
{
getDecryptType
,
getEncryptKey
}
from
"
pi_sys/util/util
"
;
import
{
formatError
,
getDecryptType
,
getEncryptKey
}
from
"
pi_sys/util/util
"
;
import
{
ICfg
}
from
"
./update_mgr
"
;
import
{
Logger
}
from
"
pi_sys/util/logger
"
;
declare
let
module
;
let
logger
=
new
Logger
(
module
.
name
,
"
sys
"
);
const
AssetsCopyDir
=
"
assets_copy
"
;
// 拷贝到data目录的目录名
const
AssetsCopyDependName
=
"
assets_copy_depend
"
;
// 记录已经拷贝的文件
...
...
@@ -105,10 +108,16 @@ const initCopyDepends = async () => {
const
isExist
=
await
access
(
copyDependPath
);
if
(
isExist
)
{
let
content
=
await
readFile
(
copyDependPath
,
"
utf8
"
)
as
string
;
let
depends
=
JSON
.
parse
(
content
);
depends
.
forEach
(
depend
=>
{
copyDependsMap
.
set
(
depend
[
0
],
depend
);
})
try
{
let
depends
=
JSON
.
parse
(
content
);
depends
.
forEach
(
depend
=>
{
copyDependsMap
.
set
(
depend
[
0
],
depend
);
})
}
catch
(
e
)
{
logger
.
error
(
"
initCopyDepends Error
"
,
formatError
(
e
))
unlink
(
copyDependPath
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help