ts-glitter 20.1.7 → 20.1.9
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/lowcode/Entry.js
CHANGED
|
@@ -21,6 +21,15 @@ import { ApiUser } from './glitter-base/route/user.js';
|
|
|
21
21
|
import { ApplicationConfig } from './application-config.js';
|
|
22
22
|
export class Entry {
|
|
23
23
|
static onCreate(glitter) {
|
|
24
|
+
const originalReplaceState = history.replaceState;
|
|
25
|
+
let count = 0;
|
|
26
|
+
let last_replace = '';
|
|
27
|
+
window.history.replaceState = function (data, unused, url) {
|
|
28
|
+
if (last_replace !== url) {
|
|
29
|
+
last_replace = `${url}`;
|
|
30
|
+
return originalReplaceState.apply(history, arguments);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
24
33
|
function next() {
|
|
25
34
|
var _a, _b;
|
|
26
35
|
if (glitter.getUrlParameter('EndCheckout') === '1') {
|
|
@@ -135,7 +144,7 @@ export class Entry {
|
|
|
135
144
|
}
|
|
136
145
|
window.renderClock = (_b = window.renderClock) !== null && _b !== void 0 ? _b : createClock();
|
|
137
146
|
console.log(`Entry-time:`, window.renderClock.stop());
|
|
138
|
-
glitter.share.editerVersion = 'V_20.1.
|
|
147
|
+
glitter.share.editerVersion = 'V_20.1.9';
|
|
139
148
|
glitter.share.start = new Date();
|
|
140
149
|
const vm = { appConfig: [] };
|
|
141
150
|
window.saasConfig = {
|
package/lowcode/Entry.ts
CHANGED
|
@@ -15,6 +15,18 @@ import { ApplicationConfig } from './application-config.js';
|
|
|
15
15
|
export class Entry {
|
|
16
16
|
// 建立初始函式
|
|
17
17
|
public static onCreate(glitter: Glitter) {
|
|
18
|
+
const originalReplaceState = history.replaceState
|
|
19
|
+
let count=0
|
|
20
|
+
let last_replace=''
|
|
21
|
+
window.history.replaceState = function(data: any, unused: string, url?: string | URL | null) {
|
|
22
|
+
if(last_replace!==url){
|
|
23
|
+
last_replace=`${url}`
|
|
24
|
+
|
|
25
|
+
//@ts-ignore
|
|
26
|
+
return originalReplaceState.apply(history, arguments);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
18
30
|
function next(){
|
|
19
31
|
//判斷結帳成功清空購物車紀錄
|
|
20
32
|
if (glitter.getUrlParameter('EndCheckout') === '1') {
|
|
@@ -134,7 +146,8 @@ export class Entry {
|
|
|
134
146
|
}
|
|
135
147
|
(window as any).renderClock = (window as any).renderClock ?? createClock();
|
|
136
148
|
console.log(`Entry-time:`, (window as any).renderClock.stop());
|
|
137
|
-
glitter.share.editerVersion = 'V_20.1.
|
|
149
|
+
glitter.share.editerVersion = 'V_20.1.9';
|
|
150
|
+
|
|
138
151
|
glitter.share.start = new Date();
|
|
139
152
|
const vm = { appConfig: [] };
|
|
140
153
|
(window as any).saasConfig = {
|
|
@@ -764,6 +764,7 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
764
764
|
window.history.replaceState({}, title || document.title, url.href);
|
|
765
765
|
}
|
|
766
766
|
catch (e) {
|
|
767
|
+
console.log(e);
|
|
767
768
|
}
|
|
768
769
|
}
|
|
769
770
|
else {
|
|
@@ -776,6 +777,7 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
776
777
|
window.history.replaceState({}, title || document.title, url.href);
|
|
777
778
|
}
|
|
778
779
|
catch (e) {
|
|
780
|
+
console.log(e);
|
|
779
781
|
}
|
|
780
782
|
}
|
|
781
783
|
}
|
|
@@ -337,17 +337,20 @@ ${(!error.message) ? `` : `錯誤訊息:${error.message}`}${(!error.lineNumber)
|
|
|
337
337
|
url.searchParams.delete('page')
|
|
338
338
|
window.history.replaceState({}, title || document.title, url.href);
|
|
339
339
|
} catch (e) {
|
|
340
|
+
console.log(e)
|
|
340
341
|
}
|
|
341
342
|
|
|
342
343
|
} else {
|
|
343
344
|
const url = new URL(location.href)
|
|
344
345
|
url.searchParams.delete(tag)
|
|
346
|
+
|
|
345
347
|
if (value) {
|
|
346
348
|
url.searchParams.set(tag, value)
|
|
347
349
|
}
|
|
348
350
|
try {
|
|
349
351
|
window.history.replaceState({},title || document.title, url.href);
|
|
350
352
|
} catch (e) {
|
|
353
|
+
console.log(e)
|
|
351
354
|
}
|
|
352
355
|
}
|
|
353
356
|
}
|
|
@@ -528,7 +528,7 @@ export class Glitter {
|
|
|
528
528
|
setUrlParameter(tag, value) {
|
|
529
529
|
var search = this.setSearchParam(this.removeSearchParam(window.location.search, tag), tag, value);
|
|
530
530
|
try {
|
|
531
|
-
window.history.
|
|
531
|
+
window.history.replaceState({}, document.title, search);
|
|
532
532
|
}
|
|
533
533
|
catch (e) {
|
|
534
534
|
}
|
|
@@ -233,7 +233,7 @@ export class Glitter {
|
|
|
233
233
|
public setUrlParameter(tag: string, value: string) {
|
|
234
234
|
var search = this.setSearchParam(this.removeSearchParam(window.location.search, tag), tag, value)
|
|
235
235
|
try {
|
|
236
|
-
window.history.
|
|
236
|
+
window.history.replaceState({}, document.title, search);
|
|
237
237
|
} catch (e) {
|
|
238
238
|
}
|
|
239
239
|
}
|