mirror of
https://github.com/smallfawn/QLScriptPublic.git
synced 2026-11-05 22:36:53 +08:00
fix bug
This commit is contained in:
1 parent
cf0b4e9a1d
commit
d07a7e867b
2 files changed
+22
-2
No files matched your search
+11
-1
@@ -11,8 +11,18 @@ function Env(t, s) {
|
||||
this.startTime = new Date().getTime();
|
||||
Object.assign(this, s);
|
||||
this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`);
|
||||
this.bucket = ''
|
||||
this.bucket = this.bucket || ''
|
||||
this.fs = require("fs");
|
||||
if (this.isNode() && this.bucket) {
|
||||
try {
|
||||
if (!this.fs.existsSync(this.bucket)) {
|
||||
this.fs.writeFileSync(this.bucket, JSON.stringify({}, null, 2));
|
||||
this.log(`📁 已创建 bucket 文件: ${this.bucket}`);
|
||||
}
|
||||
} catch (e) {
|
||||
this.log("❌ 初始化 bucket 失败: " + e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
async get(key, def = null) {
|
||||
if (!this.isNode()) return def;
|
||||
|
||||
+11
-1
@@ -11,8 +11,18 @@ function Env(t, s) {
|
||||
this.startTime = new Date().getTime();
|
||||
Object.assign(this, s);
|
||||
this.log(`\ud83d\udd14${this.name},\u5f00\u59cb!`);
|
||||
this.bucket = ''
|
||||
this.bucket = this.bucket || ''
|
||||
this.fs = require("fs");
|
||||
if (this.isNode() && this.bucket) {
|
||||
try {
|
||||
if (!this.fs.existsSync(this.bucket)) {
|
||||
this.fs.writeFileSync(this.bucket, JSON.stringify({}, null, 2));
|
||||
this.log(`📁 已创建 bucket 文件: ${this.bucket}`);
|
||||
}
|
||||
} catch (e) {
|
||||
this.log("❌ 初始化 bucket 失败: " + e.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
async get(key, def = null) {
|
||||
if (!this.isNode()) return def;
|
||||
|
||||
Reference in new issue
Block a user