yakuza0 2.22.34-beta.13 → 2.22.34-beta.15
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.
|
@@ -129,8 +129,9 @@ exports.default = function () {
|
|
|
129
129
|
case 14:
|
|
130
130
|
|
|
131
131
|
_yakuza.Cookies.remove(_config2.default.server.redirect.afkKey, { domain: $yk.appConf.cookieDomain });
|
|
132
|
+
$yk.firstRefresh = false;
|
|
132
133
|
|
|
133
|
-
case
|
|
134
|
+
case 16:
|
|
134
135
|
case 'end':
|
|
135
136
|
return _context3.stop();
|
|
136
137
|
}
|
package/package.json
CHANGED
|
@@ -22,6 +22,7 @@ const setCookie = (key, value, options) => {
|
|
|
22
22
|
|
|
23
23
|
export default async (ctx, inject) => {
|
|
24
24
|
const {redirect, $yk, req, res} = ctx
|
|
25
|
+
const appName = $yk.appName;
|
|
25
26
|
|
|
26
27
|
const $redirect = (...args) => {
|
|
27
28
|
let url = args[0]
|
|
@@ -39,13 +40,20 @@ export default async (ctx, inject) => {
|
|
|
39
40
|
setCookie(yConf.server.redirect.afkKey, "true", {res, domain: $yk.appConf.cookieDomain})
|
|
40
41
|
|
|
41
42
|
if (typeof url === 'string') {
|
|
43
|
+
const trimPrefix = $yk.hostname && $yk.hostname[appName] && $yk.hostname[appName].value || '__prefix';
|
|
44
|
+
if (_.startsWith(url, trimPrefix)) {
|
|
45
|
+
url = _.replace(url, trimPrefix, '');
|
|
46
|
+
|
|
47
|
+
if (!url.startsWith('/')) {
|
|
48
|
+
url = '/' + url
|
|
49
|
+
}
|
|
50
|
+
}
|
|
42
51
|
const parse = _.urlParse(url)
|
|
43
52
|
|
|
44
53
|
if (parse.host) {
|
|
45
54
|
isOuter = true;
|
|
46
55
|
prefix = parse.protocols ? parse.protocols : 'http://'
|
|
47
56
|
}
|
|
48
|
-
|
|
49
57
|
url = prefix + parse.crop
|
|
50
58
|
}
|
|
51
59
|
|
package/template/yk.plugin.js
CHANGED
package/utils/inclusive.js
CHANGED
|
@@ -303,7 +303,7 @@ var render = function () {
|
|
|
303
303
|
|
|
304
304
|
// docker: false,
|
|
305
305
|
mockIP: false,
|
|
306
|
-
f5Offline:
|
|
306
|
+
f5Offline: undefined,
|
|
307
307
|
passphrase: '',
|
|
308
308
|
orbProtocol: {
|
|
309
309
|
ws: 'ws:',
|
|
@@ -791,41 +791,40 @@ var render = function () {
|
|
|
791
791
|
|
|
792
792
|
case 28:
|
|
793
793
|
_context2.t1 = conf.dkyMode;
|
|
794
|
-
_context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ?
|
|
794
|
+
_context2.next = _context2.t1 === "dev" ? 31 : _context2.t1 === "normal" ? 35 : _context2.t1 === "prod" ? 39 : _context2.t1 === "stupid" ? 46 : _context2.t1 === "tire" ? 56 : 63;
|
|
795
795
|
break;
|
|
796
796
|
|
|
797
797
|
case 31:
|
|
798
798
|
// conf.security.encrypt = "none";
|
|
799
799
|
// conf.security.stupid = false;
|
|
800
800
|
// conf.security.helmet = true;
|
|
801
|
-
|
|
801
|
+
conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
|
|
802
802
|
conf.security.isDev = true;
|
|
803
803
|
conf.dev = true;
|
|
804
|
-
return _context2.abrupt('break',
|
|
804
|
+
return _context2.abrupt('break', 63);
|
|
805
805
|
|
|
806
|
-
case
|
|
806
|
+
case 35:
|
|
807
807
|
// conf.security.encrypt = "none";
|
|
808
808
|
// conf.security.stupid = false;
|
|
809
809
|
// conf.security.helmet = true;
|
|
810
|
-
|
|
810
|
+
conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
|
|
811
811
|
conf.security.isNormal = true;
|
|
812
812
|
conf.dev = false;
|
|
813
|
-
return _context2.abrupt('break',
|
|
813
|
+
return _context2.abrupt('break', 63);
|
|
814
814
|
|
|
815
|
-
case
|
|
815
|
+
case 39:
|
|
816
816
|
conf.security.encrypt = "sm";
|
|
817
817
|
conf.security.stupid = false;
|
|
818
818
|
conf.security.helmet = true;
|
|
819
|
-
|
|
819
|
+
conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
|
|
820
820
|
conf.security.isProd = true;
|
|
821
821
|
conf.dev = false;
|
|
822
|
-
return _context2.abrupt('break',
|
|
822
|
+
return _context2.abrupt('break', 63);
|
|
823
823
|
|
|
824
|
-
case
|
|
824
|
+
case 46:
|
|
825
825
|
conf.security.encrypt = "sm";
|
|
826
826
|
conf.security.stupid = true;
|
|
827
827
|
conf.security.helmet = true;
|
|
828
|
-
// conf.server.f5Offline = false;
|
|
829
828
|
conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, true);
|
|
830
829
|
conf.security.isStupid = true;
|
|
831
830
|
conf.server.csp.enabled = true;
|
|
@@ -833,20 +832,20 @@ var render = function () {
|
|
|
833
832
|
conf.server.csp.decoration = checkBoolSingle(conf.server.csp.decoration, true);
|
|
834
833
|
conf.server.sri.enabled = true;
|
|
835
834
|
// conf.dev = false;
|
|
836
|
-
return _context2.abrupt('break',
|
|
835
|
+
return _context2.abrupt('break', 63);
|
|
837
836
|
|
|
838
|
-
case
|
|
837
|
+
case 56:
|
|
839
838
|
conf.security.encrypt = "none";
|
|
840
839
|
conf.security.stupid = false;
|
|
841
840
|
conf.security.helmet = false;
|
|
842
|
-
|
|
841
|
+
conf.server.f5Offline = checkBoolSingle(conf.server.f5Offline, false);
|
|
843
842
|
conf.security.isTire = true;
|
|
844
843
|
// conf.server.heartbeat.enabled = checkBoolSingle(conf.server.heartbeat.enabled, false);
|
|
845
844
|
conf.server.heartbeat.enabled = false;
|
|
846
845
|
// conf.dev = false;
|
|
847
|
-
return _context2.abrupt('break',
|
|
846
|
+
return _context2.abrupt('break', 63);
|
|
848
847
|
|
|
849
|
-
case
|
|
848
|
+
case 63:
|
|
850
849
|
|
|
851
850
|
// conf.router.config['app.examples'].enabled = true;
|
|
852
851
|
if (conf.server.yk4Addr) {
|
|
@@ -946,7 +945,7 @@ var render = function () {
|
|
|
946
945
|
conf.server.csp.directives = directives;
|
|
947
946
|
|
|
948
947
|
// const appPortUsed = [];
|
|
949
|
-
_context2.next =
|
|
948
|
+
_context2.next = 84;
|
|
950
949
|
return _yakuza._.asyncMap(conf.router.config, function () {
|
|
951
950
|
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(v, key) {
|
|
952
951
|
var name, arr, length, num;
|
|
@@ -1131,7 +1130,7 @@ var render = function () {
|
|
|
1131
1130
|
};
|
|
1132
1131
|
}());
|
|
1133
1132
|
|
|
1134
|
-
case
|
|
1133
|
+
case 84:
|
|
1135
1134
|
// console.log(conf.router.config);
|
|
1136
1135
|
|
|
1137
1136
|
conf.shareRule.app = conf.shareRule.app.map(function (ap) {
|
|
@@ -1253,7 +1252,7 @@ var render = function () {
|
|
|
1253
1252
|
|
|
1254
1253
|
return _context2.abrupt('return', { conf: conf });
|
|
1255
1254
|
|
|
1256
|
-
case
|
|
1255
|
+
case 95:
|
|
1257
1256
|
case 'end':
|
|
1258
1257
|
return _context2.stop();
|
|
1259
1258
|
}
|