From 072de941dc14eca12ffa90f2630bbbaeca542f98 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 14 四月 2025 17:19:50 +0800 Subject: [PATCH] Merge branch 'positec' into dms --- src/api/index.js | 32 +++++++++++++++++++++++++++----- 1 files changed, 27 insertions(+), 5 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 2b7208c..a49a84a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -60,10 +60,12 @@ localStorage.removeItem('role_id') localStorage.removeItem('mk_user_type') - sessionStorage.clear() - if (!!(window.history && window.history.pushState)) { - window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') - window.location.reload() + if (!/#\/login/.test(window.location.href)) { + sessionStorage.clear() + if (!!(window.history && window.history.pushState)) { + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + } } } }) @@ -71,6 +73,10 @@ return Promise.reject(response.data) } else { + if (response.data.ErrCode === 'E' && /姝婚攣/.test(response.data.message)) { + response.data.message = window.GLOB.dict['server_busy'] || '鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇曪紒' + response.data.ErrMesg = response.data.message + } if (response.config.requestId) { response.data.$requestId = response.config.requestId } @@ -79,7 +85,15 @@ }, (error) => { let response = error.response || '' - if (response && response.status) { + if (!response) { + notification.error({ + className: 'notification-custom-error', + bottom: 0, + message: error.message.includes('Network Error') && sessionStorage.getItem('lang') === 'zh-CN' ? '缃戠粶杩炴帴澶辫触锛�' : error.message, + placement: 'bottomRight', + duration: 15 + }) + } else if (response && response.status) { notification.error({ className: 'notification-custom-error', bottom: 0, @@ -1092,6 +1106,14 @@ param.data_md5 = param.data_md5 || '' param.time_limit = param.time_limit || 0 + param.data.forEach(item => { + item.exps.forEach(cell => { + if (typeof(cell.value) === 'number') { + cell.value = cell.value + '' + } + }) + }) + param = this.encryptParam(param) return new Promise((resolve) => { -- Gitblit v1.8.0