@Interceptor(priority = 12, name = "路由拦截")
public class MidderProductInterceptor implements IInterceptor {
private Context mContext;
@Override
public void process(Postcard postcard, InterceptorCallback callback) {
//未登陆&是订单详情 那么登陆并跳转
if (postcard.getPath().equals("/experience/midder_product_contrast")) {
postcard.withFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
}
callback.onContinue(postcard);
}
@Override
public void init(Context context) {
this.mContext = context;
}
}
网友评论