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 | 82 +++++++++++++++++++++++++++++++++++++++-- 1 files changed, 78 insertions(+), 4 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 3c611c1..a49a84a 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -48,6 +48,18 @@ okText: '鐭ラ亾浜�', onOk: () => { window.GLOB.$error = false + + localStorage.removeItem('UserID') + localStorage.removeItem('LoginUID') + localStorage.removeItem('User_Name') + localStorage.removeItem('Full_Name') + localStorage.removeItem('avatar') + localStorage.removeItem('dataM') + localStorage.removeItem('localDataM') + localStorage.removeItem('debug') + localStorage.removeItem('role_id') + localStorage.removeItem('mk_user_type') + if (!/#\/login/.test(window.location.href)) { sessionStorage.clear() if (!!(window.history && window.history.pushState)) { @@ -62,8 +74,8 @@ return Promise.reject(response.data) } else { if (response.data.ErrCode === 'E' && /姝婚攣/.test(response.data.message)) { - response.data.message = '鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇曪紒' - response.data.ErrMesg = '鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇曪紒' + response.data.message = window.GLOB.dict['server_busy'] || '鏈嶅姟鍣ㄧ箒蹇欙紝璇风◢鍚庨噸璇曪紒' + response.data.ErrMesg = response.data.message } if (response.config.requestId) { response.data.$requestId = response.config.requestId @@ -73,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, @@ -131,6 +151,25 @@ } /** + * @description 浣跨敤dostar鎺ュ彛锛岃烦杩囬獙璇� + * @param {Object} param 鏌ヨ鍙婃彁浜ゅ弬鏁� + */ + loginAndRedirect (param) { + let url = '' + if (process.env.NODE_ENV === 'production') { + url = document.location.origin + '/zh-CN/Home/LoginAndRedirect' + } else { + url = window.GLOB.location + '/zh-CN/Home/LoginAndRedirect' + } + + return axios({ + url: url, + method: 'post', + data: qs.stringify(param) + }) + } + + /* @description 鐩存帴璇锋眰 * @description 寰俊涓氬姟璇锋眰 鍘熸帴鍙� 'wxpay/getaccesstoken' */ // wxAccessToken (appId, domain = '') { @@ -313,6 +352,11 @@ // Type: 'X' 鏃� // param.Password = Utils.formatOptions(password) + // positecgroup + if (window.GLOB.appkey === '202011021844144334E823A3011414082AD77') { + param.svccode = 'oms' + } + let url = '/webapi/dologon' if (isCloud) { @@ -360,6 +404,36 @@ resolve({data: null, valid: false}) } }) + }) + } + + /** + * @description 鐧诲綍浜屾楠岃瘉 // positecgroup + */ + verifycode (verify) { + let param = { + certificate: 'certificate', + captcha: verify.code, + token: verify.token, + ati: verify.ati, + vid: verify.vid, + uid: verify.uid, + shopId: verify.shopId, + loginId: verify.loginId, + phone: verify.phone, + sellerNick: verify.sellerNick, + isRisk: verify.isRisk, + requestId: verify.requestId, + riskNum: verify.riskNum, + username: verify.username + } + + let url = '/webapi/dologon' + + return axios({ + url, + method: 'post', + data: param }) } @@ -742,7 +816,7 @@ } let url = '/webapi/dostars' - if (param.rduri && !window.GLOB.transfer) { + if (param.rduri && !window.GLOB.transfer) { // positecgroup url = param.rduri delete param.rduri } -- Gitblit v1.8.0