diff --git a/frontend/src/views/chart/view/ChartEdit.vue b/frontend/src/views/chart/view/ChartEdit.vue index eee9c4b24a..67efd06237 100644 --- a/frontend/src/views/chart/view/ChartEdit.vue +++ b/frontend/src/views/chart/view/ChartEdit.vue @@ -2007,6 +2007,7 @@ export default { bus.$off('show-quota-edit-filter', this.showQuotaEditFilter) bus.$off('show-quota-edit-compare', this.showQuotaEditCompare) bus.$off('show-edit-filter', this.showEditFilter) + bus.$off('show-edit-formater', this.valueFormatter) bus.$off('calc-data', this.calcData) bus.$off('plugins-calc-style', this.calcStyle) bus.$off('plugin-chart-click', this.chartClick) @@ -2077,6 +2078,7 @@ export default { bus.$on('show-quota-edit-filter', this.showQuotaEditFilter) bus.$on('show-quota-edit-compare', this.showQuotaEditCompare) bus.$on('show-edit-filter', this.showEditFilter) + bus.$on('show-edit-formater', this.valueFormatter) bus.$on('calc-data', this.calcData) bus.$on('plugins-calc-style', this.calcStyle) bus.$on('plugin-chart-click', this.chartClick) diff --git a/mobile/src/common/js/request/index.js b/mobile/src/common/js/request/index.js index b78e56abe3..78cf6217b1 100644 --- a/mobile/src/common/js/request/index.js +++ b/mobile/src/common/js/request/index.js @@ -60,10 +60,13 @@ checkAuth(error.response) } else { msg = error.message } + if (msg?.startsWith('MultiLoginError')) { + return Promise.reject(error) + } uni.showToast({ icon: 'error', title: msg - }); + }) return Promise.reject(error) }) const logout = () => { diff --git a/mobile/src/locale/en.json b/mobile/src/locale/en.json index a7b72f12c3..0097978654 100644 --- a/mobile/src/locale/en.json +++ b/mobile/src/locale/en.json @@ -31,7 +31,8 @@ "loginbtn": "Login", "pwdFmtError": "Password Must More Than 6 Characters", "uOrpwdError": "Invalid Account Or Password", - "accFmtError": "Account Must More Than 1 Characters" + "accFmtError": "Account Must More Than 1 Characters", + "multiLogin": "The current account is online,Prohibit multi-terminal login" }, "home": { "tab1": "My Favorites", diff --git a/mobile/src/locale/zh-Hans.json b/mobile/src/locale/zh-Hans.json index 3da2e19ea1..9cda6a34d0 100644 --- a/mobile/src/locale/zh-Hans.json +++ b/mobile/src/locale/zh-Hans.json @@ -31,7 +31,8 @@ "loginbtn": "登录", "pwdFmtError": "密码最短为1个字符", "accFmtError": "账号最短为1个字符", - "uOrpwdError": "无效账号或密码" + "uOrpwdError": "无效账号或密码", + "multiLogin": "当前账号已在线,禁止多端登录" }, "home": { "tab1": "我的收藏", diff --git a/mobile/src/locale/zh-Hant.json b/mobile/src/locale/zh-Hant.json index ff6fb1f846..29f86ac07f 100644 --- a/mobile/src/locale/zh-Hant.json +++ b/mobile/src/locale/zh-Hant.json @@ -32,7 +32,8 @@ "loginbtn": "登錄", "pwdFmtError": "密碼最短為6個字符", "uOrpwdError": "無效賬號或密碼", - "accFmtError": "帳號最短為1個字符" + "accFmtError": "帳號最短為1個字符", + "multiLogin": "當前賬號已在線,禁止多端登錄" }, "home": { "tab1": "我的收藏", diff --git a/mobile/src/pages/login/index.vue b/mobile/src/pages/login/index.vue index 5c68fc6808..73507967d1 100644 --- a/mobile/src/pages/login/index.vue +++ b/mobile/src/pages/login/index.vue @@ -106,9 +106,13 @@ }).catch(error => { this.loginBtnLoading = false + let msg = error.response.data.message + if (msg?.startsWith('MultiLoginError')) { + msg = this.$t('login.multiLogin') + } uni.showToast({ icon: 'error', - title: error.response.data.message, + title: msg, }); }) }, diff --git a/mobile/src/pages/tabBar/me/index.vue b/mobile/src/pages/tabBar/me/index.vue index f4f138b50a..52090cd02f 100644 --- a/mobile/src/pages/tabBar/me/index.vue +++ b/mobile/src/pages/tabBar/me/index.vue @@ -36,7 +36,8 @@