浏览代码

去掉插件定义中调用callback的isEscape参数

zhanglong7 6 年之前
父节点
当前提交
cd630b11e8

+ 1 - 1
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileFile.java

113
		try {
113
		try {
114
			String absolutePath = util.getDirection(relativePath, isSdcard == null ? true : isSdcard);
114
			String absolutePath = util.getDirection(relativePath, isSdcard == null ? true : isSdcard);
115
			String value = FileUtil.readFile(absolutePath);
115
			String value = FileUtil.readFile(absolutePath);
116
			callback(value,isEncode == null ? true : isEncode);
116
			callback(value);
117
		} catch (Exception e) {
117
		} catch (Exception e) {
118
			throw new IpuMobileException(e);
118
			throw new IpuMobileException(e);
119
		}
119
		}

+ 1 - 1
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileLocalLogic.java

37
			protected void execute() throws Exception {
37
			protected void execute() throws Exception {
38
				// TODO Auto-generated method stub
38
				// TODO Auto-generated method stub
39
				Object result = dataRequest(dataAction, isNull(data) ? null : new DataMap(data));
39
				Object result = dataRequest(dataAction, isNull(data) ? null : new DataMap(data));
40
				MobileLocalLogic.this.callback(result.toString(), true);
40
				MobileLocalLogic.this.callback(result.toString());
41
			}
41
			}
42
		}.start();
42
		}.start();
43
	}
43
	}

+ 7 - 7
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileNetWork.java

86
						resultData.put(FuncConstant.SENDER, sender);
86
						resultData.put(FuncConstant.SENDER, sender);
87
						resultData.put(FuncConstant.TIME, time);
87
						resultData.put(FuncConstant.TIME, time);
88
						String result = resultData.toString();
88
						String result = resultData.toString();
89
						callback(result, true);
89
						callback(result);
90
						hasSetSmsListener = false;
90
						hasSetSmsListener = false;
91
						return true;
91
						return true;
92
					} else {
92
					} else {
110
		} catch (Exception e) {
110
		} catch (Exception e) {
111
			result = "{\"X_RESULTCODE\":\"-1\",\"X_RESULTINFO\":\"" + e.getMessage() + "\"}";
111
			result = "{\"X_RESULTCODE\":\"-1\",\"X_RESULTINFO\":\"" + e.getMessage() + "\"}";
112
		}
112
		}
113
		callback(result, true);
113
		callback(result);
114
	}
114
	}
115
115
116
	public String httpRequest(String requestUrl, String encode) throws Exception {
116
	public String httpRequest(String requestUrl, String encode) throws Exception {
145
		} catch (Exception e) {
145
		} catch (Exception e) {
146
			result = e.getMessage();
146
			result = e.getMessage();
147
		}
147
		}
148
		callback(result, true);
148
		callback(result);
149
	}
149
	}
150
150
151
	public String httpGet(String requestUrl, String encode) throws Exception {
151
	public String httpGet(String requestUrl, String encode) throws Exception {
172
		} 
172
		} 
173
		String result = isNull(headers) ? dataRequest(dataAction, isNull(data) ? null : new DataMap(data)) :
173
		String result = isNull(headers) ? dataRequest(dataAction, isNull(data) ? null : new DataMap(data)) :
174
			 dataRequest(dataAction, isNull(data) ? null : new DataMap(data),new DataMap(headers));
174
			 dataRequest(dataAction, isNull(data) ? null : new DataMap(data),new DataMap(headers));
175
		callback(result, true);
175
		callback(result);
176
	}
176
	}
177
	
177
	
178
	public void dataRequestWithHost(JSONArray param) throws Exception {
178
	public void dataRequestWithHost(JSONArray param) throws Exception {
187
		}
187
		}
188
        String result = isNull(headers) ? dataRequestWithHost(requestUrl, dataAction, isNull(data) ? null : new DataMap(data)) :
188
        String result = isNull(headers) ? dataRequestWithHost(requestUrl, dataAction, isNull(data) ? null : new DataMap(data)) :
189
        	dataRequestWithHost(requestUrl, dataAction, isNull(data) ? null : new DataMap(data), new DataMap(headers));
189
        	dataRequestWithHost(requestUrl, dataAction, isNull(data) ? null : new DataMap(data), new DataMap(headers));
190
        callback(result, true);
190
        callback(result);
191
    }
191
    }
192
	
192
	
193
	/**
193
	/**
443
				// TODO Auto-generated method stub
443
				// TODO Auto-generated method stub
444
				super.onPostExecute(result);
444
				super.onPostExecute(result);
445
				if (result != null) {
445
				if (result != null) {
446
					MobileNetWork.this.callback(result, true);// 正常回调
446
					MobileNetWork.this.callback(result);// 正常回调
447
				}
447
				}
448
			}
448
			}
449
		}.execute(postData);
449
		}.execute(postData);
488
				// TODO Auto-generated method stub
488
				// TODO Auto-generated method stub
489
				super.onPostExecute(savePath);
489
				super.onPostExecute(savePath);
490
				if (savePath != null) {
490
				if (savePath != null) {
491
					MobileNetWork.this.callback(savePath, true);// 正常回调
491
					MobileNetWork.this.callback(savePath);// 正常回调
492
				}
492
				}
493
			}
493
			}
494
		}.execute();
494
		}.execute();

+ 5 - 5
ipu-plugin-basic/src/main/java/com/ai/ipu/mobile/plugin/MobileUI.java

310
		String pageAction = param.getString(0);
310
		String pageAction = param.getString(0);
311
		String data = param.getString(1);
311
		String data = param.getString(1);
312
		String html = getTemplate(pageAction, isNull(data) ? null : new DataMap(data));
312
		String html = getTemplate(pageAction, isNull(data) ? null : new DataMap(data));
313
		callback(html, true);
313
		callback(html);
314
	}
314
	}
315

315

316
	/**
316
	/**
347
		String html = getPage(pageAction, isNull(data) ? null : new DataMap(data));
347
		String html = getPage(pageAction, isNull(data) ? null : new DataMap(data));
348
		// modify by wyj,当数据接口调用失败时,不再执行回调函数
348
		// modify by wyj,当数据接口调用失败时,不再执行回调函数
349
		if(!DATA_REQUEST_ERROR.equals(html)) {
349
		if(!DATA_REQUEST_ERROR.equals(html)) {
350
			callback(html, true);
350
			callback(html);
351
		}
351
		}
352
	}
352
	}
353

353

1037
					.getStringExtra(CustomDialogActivity.KEY_RESULT);
1037
					.getStringExtra(CustomDialogActivity.KEY_RESULT);
1038
			if (resultData != null) {
1038
			if (resultData != null) {
1039
				// 特殊字符转义
1039
				// 特殊字符转义
1040
				callback(resultData, true);
1040
				callback(resultData);
1041
			}
1041
			}
1042
		} else if (requestCode == REQUEST_CODE_CUSTOM_WINDOW) {
1042
		} else if (requestCode == REQUEST_CODE_CUSTOM_WINDOW) {
1043
			if (intent == null)
1043
			if (intent == null)
1046
					.getStringExtra(CustomWindowActivity.KEY_RESULT);
1046
					.getStringExtra(CustomWindowActivity.KEY_RESULT);
1047
			if (resultData != null) {
1047
			if (resultData != null) {
1048
				// 特殊字符转义
1048
				// 特殊字符转义
1049
				callback(resultData, true);
1049
				callback(resultData);
1050
			}
1050
			}
1051
		} else if (requestCode == REQUEST_CODE_SLIDING_MENU) {
1051
		} else if (requestCode == REQUEST_CODE_SLIDING_MENU) {
1052
			if (intent == null)
1052
			if (intent == null)
1055
					.getStringExtra(SlidingMenuActivity.KEY_RESULT);
1055
					.getStringExtra(SlidingMenuActivity.KEY_RESULT);
1056
			if (resultData != null) {
1056
			if (resultData != null) {
1057
				// 特殊字符转义
1057
				// 特殊字符转义
1058
				callback(resultData, true);
1058
				callback(resultData);
1059
			}
1059
			}
1060
		} else if (requestCode == REQUEST_CODE_CONTACTS_VIEW) {
1060
		} else if (requestCode == REQUEST_CODE_CONTACTS_VIEW) {
1061
			if (intent == null) {
1061
			if (intent == null) {