Skip to content

Instantly share code, notes, and snippets.

View vihuela's full-sized avatar

ricky vihuela

  • ShenZhen
View GitHub Profile
@vihuela
vihuela / 111
Created March 18, 2020 10:11
1111
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: <-- 500 Internal Server Error http://129.204.125.223:8001/xe.user.account.bind.wx/1.0.0 (408ms)
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Server: nginx
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Content-Type: text/html; charset=UTF-8
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Transfer-Encoding: chunked
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Connection: keep-alive
2020-03-18 18:07:58.277 4464-9083/com.xiaoe.merchant.debug D/OkHttp: X-Powered-By: PHP/7.1.21
2020-03-18 18:07:58.278 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Cache-Control: no-cache, private
2020-03-18 18:07:58.278 4464-9083/com.xiaoe.merchant.debug D/OkHttp: Date: Wed, 18 Mar 2020 10:08:31 GMT
2020-03-18 18:07:58.279 4464-9083/com.xiaoe.merchant.debug D/OkHttp: <!DOCTYPE html>
2020-03-18 18:07:58.279 4464-9083/com.xiaoe.merchant.debug D/OkHttp: <html>
@vihuela
vihuela / LoginUtils.kt
Created August 20, 2018 07:18
login demo
@Router(RouterImpl.LoginUtils)
class LoginUtils : Activity() {
val LOGIN_CODE = 1024
companion object {
var mCallback: () -> Unit? = {}
fun isLogin(context: Context, callback: () -> Unit) {
val login = AccountUtil.getAccount().isLogin
if (login) {
fun getScheduleList(view: IView, success: (d: List<TreeNode<*>>) -> Unit, failure: () -> Unit) {
running = getBehavior(running)
Observable.just(source)
.doOnSubscribe {
source.clear()
}
.defPolicy(this)
.bindToBehavior(running!!)
.observeOn(Schedulers.io())
.flatMap {
fun getTargetFile(context: Context, uri: Uri, getFile: (f: File?) -> Unit) {
val targetPath = when (uri.authority) {
//拍照
AUTHORITY -> "${Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES)}/${uri.path.substring(uri.path.lastIndexOf("/") + 1, uri.path.length)}"
//图库选择
"media" -> PhotoMetadataUtils.getPath(context.contentResolver, uri)
else -> {
getFile.invoke(null)
null