| | |
| | | clickAction: (responseString: String?) -> Unit, |
| | | clickActionError: (code: Int, errorString: String?) -> Unit |
| | | ) { |
| | | callNet(false, showDialog, api, map, clickAction, clickActionError) |
| | | } |
| | | |
| | | fun BaseActivity.callNet( |
| | | isUseAllTrustService: Boolean, |
| | | showDialog: Boolean, |
| | | api: String, |
| | | map: HashMap<String?, Any?>, |
| | | clickAction: (responseString: String?) -> Unit, |
| | | clickActionError: (code: Int, errorString: String?) -> Unit |
| | | ) { |
| | | if (showDialog) |
| | | showDialog() |
| | | if (api.startsWith("api")) { |
| | | map["appid"] = getAppId() |
| | | var sign = DES.getSign(map) |
| | | val sign = DES.getSign(map) |
| | | map["sign"] = sign |
| | | } |
| | | HttpManager.getInstance().post(api, map, object : MyObserver(this) { |
| | | HttpManager.getInstance().post(isUseAllTrustService, api, map, object : MyObserver(this) { |
| | | override fun success(responseString: String?) { |
| | | if (showDialog) |
| | | dismissDialog() |
| | |
| | | fun getAppId(): String { |
| | | var appid = CacheKey.getKeyStr("appid") |
| | | if (appid.isEmpty()) { |
| | | return "" |
| | | return "0" |
| | | } else { |
| | | return appid |
| | | } |