@jayfong/x-server 1.15.0 → 1.15.3
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.15.3](https://github.com/jfWorks/x-server/compare/v1.15.2...v1.15.3) (2022-04-26)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* verify ([aeaddd0](https://github.com/jfWorks/x-server/commit/aeaddd0eb307e815ee3d8f92e48dd7755cabce89))
|
|
11
|
+
|
|
12
|
+
### [1.15.2](https://github.com/jfWorks/x-server/compare/v1.15.1...v1.15.2) (2022-04-26)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* 验证码应取小写判断 ([36fa3f8](https://github.com/jfWorks/x-server/commit/36fa3f83374777740c28b1775efc4d1f5694a918))
|
|
18
|
+
|
|
19
|
+
### [1.15.1](https://github.com/jfWorks/x-server/compare/v1.15.0...v1.15.1) (2022-04-26)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* env ([4ae102e](https://github.com/jfWorks/x-server/commit/4ae102eabe2fb0f99f6367d75314d9b2db6b556e))
|
|
25
|
+
* envs ([6fe04ee](https://github.com/jfWorks/x-server/commit/6fe04eedcc2875edd5e0b7398b3fe8f7a826c3e1))
|
|
26
|
+
|
|
5
27
|
## [1.15.0](https://github.com/jfWorks/x-server/compare/v1.14.1...v1.15.0) (2022-04-26)
|
|
6
28
|
|
|
7
29
|
|
|
@@ -23,7 +23,7 @@ var _vtils = require("vtils");
|
|
|
23
23
|
|
|
24
24
|
class BuildUtil {
|
|
25
25
|
static async build(options) {
|
|
26
|
-
var _options$minify;
|
|
26
|
+
var _options$minify, _options$inlineEnvs;
|
|
27
27
|
|
|
28
28
|
const mainFile = _nodePath.default.join(options.cwd, 'src/main.ts');
|
|
29
29
|
|
|
@@ -75,10 +75,10 @@ class BuildUtil {
|
|
|
75
75
|
sourcemap: false,
|
|
76
76
|
treeShaking: true,
|
|
77
77
|
banner: {
|
|
78
|
-
js:
|
|
78
|
+
js: `${`;${(_options$inlineEnvs = options.inlineEnvs) == null ? void 0 : _options$inlineEnvs.map(env => `process.env[${JSON.stringify(env.key)}]=${JSON.stringify(env.value)}`).join(';')}` || ''};process.env.X_SERVER_ENVS=${JSON.stringify((options.inlineEnvs || []).reduce((res, item) => {
|
|
79
79
|
res[item.key] = item.value;
|
|
80
80
|
return res;
|
|
81
|
-
}, {}))}
|
|
81
|
+
}, {}))};`
|
|
82
82
|
},
|
|
83
83
|
plugins: [{
|
|
84
84
|
name: 'extract-assets',
|
|
@@ -46,8 +46,13 @@ class CaptchaService {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const expectedCode = await _x.x.cache.get(options.token);
|
|
49
|
+
|
|
50
|
+
if (expectedCode == null) {
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
|
|
49
54
|
await _x.x.cache.remove(options.token);
|
|
50
|
-
return options.code === expectedCode;
|
|
55
|
+
return options.code.toLowerCase() === expectedCode.toLowerCase();
|
|
51
56
|
}
|
|
52
57
|
|
|
53
58
|
}
|
package/lib/cli/build_util.js
CHANGED
|
@@ -8,7 +8,7 @@ import path from 'node:path';
|
|
|
8
8
|
import { dedent, uniq } from 'vtils';
|
|
9
9
|
export class BuildUtil {
|
|
10
10
|
static async build(options) {
|
|
11
|
-
var _options$minify;
|
|
11
|
+
var _options$minify, _options$inlineEnvs;
|
|
12
12
|
|
|
13
13
|
const mainFile = path.join(options.cwd, 'src/main.ts');
|
|
14
14
|
const pkgFile = path.join(options.cwd, 'package.json');
|
|
@@ -51,10 +51,10 @@ export class BuildUtil {
|
|
|
51
51
|
sourcemap: false,
|
|
52
52
|
treeShaking: true,
|
|
53
53
|
banner: {
|
|
54
|
-
js:
|
|
54
|
+
js: `${`;${(_options$inlineEnvs = options.inlineEnvs) == null ? void 0 : _options$inlineEnvs.map(env => `process.env[${JSON.stringify(env.key)}]=${JSON.stringify(env.value)}`).join(';')}` || ''};process.env.X_SERVER_ENVS=${JSON.stringify((options.inlineEnvs || []).reduce((res, item) => {
|
|
55
55
|
res[item.key] = item.value;
|
|
56
56
|
return res;
|
|
57
|
-
}, {}))}
|
|
57
|
+
}, {}))};`
|
|
58
58
|
},
|
|
59
59
|
plugins: [{
|
|
60
60
|
name: 'extract-assets',
|
package/lib/services/captcha.js
CHANGED
|
@@ -36,8 +36,13 @@ export class CaptchaService {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const expectedCode = await x.cache.get(options.token);
|
|
39
|
+
|
|
40
|
+
if (expectedCode == null) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
await x.cache.remove(options.token);
|
|
40
|
-
return options.code === expectedCode;
|
|
45
|
+
return options.code.toLowerCase() === expectedCode.toLowerCase();
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
}
|