Showing
1 changed file
with
0 additions
and
30 deletions
@@ -63,41 +63,11 @@ class Service { | @@ -63,41 +63,11 @@ class Service { | ||
63 | 63 | ||
64 | _post(path, data) { | 64 | _post(path, data) { |
65 | let method = path ? this.url + path : API_HOST; | 65 | let method = path ? this.url + path : API_HOST; |
66 | - let pathIndex = g_sourceApiArry.indexOf(path); | ||
67 | 66 | ||
68 | - let executeReq = () => { | ||
69 | - //适配服务器更换Java接口,开关控制是否切换 | ||
70 | - if (app.globalData.switch_javaApiEnable && pathIndex >= 0 && pathIndex < g_toJavaApiArry.length) { | ||
71 | - method = API_HOST; | ||
72 | - data.method = g_toJavaApiArry[pathIndex]; | ||
73 | - } | ||
74 | return POST(method, data).then(result => { | 67 | return POST(method, data).then(result => { |
75 | - | ||
76 | - //适配服务器更换Java接口,开关控制是否切换 | ||
77 | - if (app.globalData.switch_javaApiEnable && pathIndex >= 0) { | ||
78 | - let newData = Humps.decamelizeKeys(result.data); | ||
79 | - result.data = newData; | ||
80 | - } | ||
81 | return result; | 68 | return result; |
82 | }); | 69 | }); |
83 | } | 70 | } |
84 | - | ||
85 | - if (!app.globalData.hasSetSwitch) { | ||
86 | - return iconfSwitch().then(data => { | ||
87 | - console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> _post switch'); | ||
88 | - app.globalData.hasSetSwitch = true; | ||
89 | - if (data['disableJavaApi'] && md5('disableJavaApi') === data['disableJavaApi']) { // TODO 键值确认 | ||
90 | - app.globalData.switch_javaApiEnable = false; | ||
91 | - } | ||
92 | - return executeReq(); | ||
93 | - }, () => { | ||
94 | - app.globalData.hasSetSwitch = true; | ||
95 | - return executeReq(); | ||
96 | - }); | ||
97 | - } else { | ||
98 | - return executeReq(); | ||
99 | - } | ||
100 | - } | ||
101 | } | 71 | } |
102 | 72 | ||
103 | export default Service; | 73 | export default Service; |
-
Please register or login to post a comment