Browse Source

mobile depoly

RainMan 2 years ago
parent
commit
f09ac48659

+ 1 - 1
mobile-src/src/services/common.service.ts

@@ -521,7 +521,7 @@ export default class CommonService implements ICommonService, ILogerService {
             switch (error.message || error.busiMessage) {
             switch (error.message || error.busiMessage) {
                 case 'exception.session.invalid':
                 case 'exception.session.invalid':
                     this._shared.checkLogout().then(() => {
                     this._shared.checkLogout().then(() => {
-                        this.openToast('LOGIN.MSG_SESSION_INVALID', null, null, 'LOGIN.TIT_LOGIN', 'warning');
+                        this.openToast('Session Invalid!!', null, null, 'Login Error', 'warning');
                         this.changePage('/login');
                         this.changePage('/login');
                     });
                     });
                     break;
                     break;

+ 1 - 1
mobile-src/src/services/shared.service.ts

@@ -620,7 +620,7 @@ export default class SharedService implements ILogerService {
                     .catch((error) => {
                     .catch((error) => {
                         switch (error?.message) {
                         switch (error?.message) {
                             case 'exception.session.invalid':
                             case 'exception.session.invalid':
-                                this._commonService.openToast('LOGIN.MSG_SESSION_INVALID');
+                                this._commonService.openToast('Session Invalid!!', null, null, 'Login Error', 'warning');
                                 resolve(false);
                                 resolve(false);
                                 break;
                                 break;
                             default:
                             default:

+ 50 - 22
mobile-src/src/views/components/SgcConsole.vue

@@ -24,35 +24,16 @@ import { defineComponent } from 'vue';
 import CommonService from './../../services/common.service';
 import CommonService from './../../services/common.service';
 const commonService: CommonService = CommonService.getInstance();
 const commonService: CommonService = CommonService.getInstance();
 
 
-const logsDatas: ConsoleLogVo[] = [];
-let timer: any = null;
-
 export default defineComponent({
 export default defineComponent({
 	name: 'SgcConsole',
 	name: 'SgcConsole',
 	components: {
 	components: {
 		IonIcon,
 		IonIcon,
 	},
 	},
 	mounted() {
 	mounted() {
-		window.setTimeout(() => {
-			commonService.setLogger(this);
-			timer = window.setInterval(() => {
-				if (logsDatas.length > 0) {
-					let log = logsDatas.shift();
-					while (log) {
-						this.dataList.push(log);
-						log = logsDatas.shift();
-					}
-					logsDatas.length = 0;
-					if (this.dataList.length > 30) {
-						this.dataList.shift();
-					}
-				}
-			}, 500);
-		}, 1000);
+		commonService.setLogger(this);
 	},
 	},
 	unmounted() {
 	unmounted() {
 		commonService.setLogger(null);
 		commonService.setLogger(null);
-		window.clearInterval(timer);
 	},
 	},
 	setup() {
 	setup() {
 		return {
 		return {
@@ -70,8 +51,55 @@ export default defineComponent({
 				commonService.openToast('MSG_SERVER_ERROR');
 				commonService.openToast('MSG_SERVER_ERROR');
 			}
 			}
 		},
 		},
-		consoleLog(type: ConsoleLogType, title: string, ...obj: any[]) {
-			logsDatas.push({ type: type, title: title, datas: obj, showDetail: false });
+		_getLogObject(obj: any) {
+			switch (typeof obj) {
+				case 'number':
+				case 'string':
+				case 'boolean':
+					return obj;
+				case 'object':
+					if (Array.isArray(obj)) {
+						return 'Array[' + obj.length + ']';
+					} else if (obj.toString) {
+						return obj.toString();
+					} else {
+						return 'object';
+					}
+				default:
+					return 'unknown';
+			}
+		},
+		consoleLog(type: ConsoleLogType, title: string, ...objs: any[]) {
+			const datas: any[] = [];
+			if (objs !== null && objs !== undefined && objs.length > 0) {
+				objs.forEach(obj => {
+					switch (typeof obj) {
+						case 'number':
+						case 'string':
+						case 'boolean':
+							datas.push(obj);
+							break;
+						case 'object':
+							if (Array.isArray(obj)) {
+								const arrayItem: any[] = [];
+								obj.forEach(item => {
+									arrayItem.push(this._getLogObject(item));
+								});
+								datas.push(arrayItem);
+							} else {
+								datas.push(this._getLogObject(obj));
+							}
+							break;
+						default:
+							datas.push(typeof obj);
+							break;
+					}
+				});
+			}
+			this.dataList.push({ type: type, title: title, datas: datas, showDetail: false });
+			if (this.dataList.length > 30) {
+				this.dataList.shift();
+			}
 		},
 		},
 		toggleLog(log: ConsoleLogVo) {
 		toggleLog(log: ConsoleLogVo) {
 			log.showDetail = !log.showDetail;
 			log.showDetail = !log.showDetail;

File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/index.html


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/js/app.2c5c63ed.js


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/js/app.2c5c63ed.js.map


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/js/app.5137e84b.js


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/js/app.5137e84b.js.map


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/service-worker.js


File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/mobile/service-worker.js.map


Some files were not shown because too many files changed in this diff