Commit d63bf6d5 authored by linfeng's avatar linfeng

Merge branch 'dev_im' of http://113.105.137.151:22280/lify/rvapp into master-video

parents d8c48563 7e4fbcbc
......@@ -6,6 +6,8 @@ import android.content.Intent;
import android.text.TextUtils;
import com.ruiwenliu.wrapper.base.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.LoginRvActivity;
import com.yuyife.okgo.OkGoUtil;
public class HomePresenter extends CommonPresenter {
......@@ -16,6 +18,12 @@ public class HomePresenter extends CommonPresenter {
* @param title
*/
public void toTarget(Context context, String url, String title) {
if (!TextUtils.isEmpty(url) && url.contains("login=1")) {
if (!isLogin(context)) {
return;
}
}
if (url.startsWith("http")) {
ComponentName componentName = new ComponentName(context, "com.rv.share.WebViewActivity");
Intent intent = new Intent();
......@@ -45,8 +53,21 @@ public class HomePresenter extends CommonPresenter {
}
}
}
context.startActivity(intent);
}
}
}
/**
* 判断是否登录
*
* @return
*/
private boolean isLogin(Context context) {
if (TextUtils.isEmpty(OkGoUtil.getToken())) {
context.startActivity(LoginRvActivity.getIntent(context, 0));
return false;
}
return true;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment