@maiyunnet/kebab 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/kv.js +5 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* --- 本文件用来定义每个目录实体地址的常量 ---
|
|
7
7
|
*/
|
|
8
8
|
/** --- 当前系统版本号 --- */
|
|
9
|
-
export const VER = '4.0.
|
|
9
|
+
export const VER = '4.0.1';
|
|
10
10
|
// --- 服务端用的路径 ---
|
|
11
11
|
const imu = decodeURIComponent(import.meta.url).replace('file://', '').replace(/^\/(\w:)/, '$1');
|
|
12
12
|
/** --- /xxx/xxx --- */
|
package/lib/kv.js
CHANGED
|
@@ -52,12 +52,15 @@ export class Kv {
|
|
|
52
52
|
const configKv = ctr.getPrototype('_config').kv;
|
|
53
53
|
const user = etc?.user ?? configKv.user;
|
|
54
54
|
const pwd = etc?.pwd ?? configKv.pwd;
|
|
55
|
-
|
|
55
|
+
if (pwd) {
|
|
56
|
+
await this._link.auth(pwd, user || undefined);
|
|
57
|
+
}
|
|
56
58
|
await this._link.select(this._index);
|
|
57
59
|
return true;
|
|
58
60
|
}
|
|
59
|
-
catch {
|
|
61
|
+
catch (e) {
|
|
60
62
|
// --- 初始化失败,移除 ---
|
|
63
|
+
lCore.debug('[KV][init][error]', e);
|
|
61
64
|
const item = connections.findIndex(item => item.link === this._link);
|
|
62
65
|
if (item !== -1) {
|
|
63
66
|
connections.splice(item, 1);
|