OKHttp学习(一)—OKHttp的工作原理

本文详细解读了OkHttp框架中的四个关键拦截器:RetryAndFollowUpInterceptor处理请求重试,BridgeInterceptor负责构建HTTP请求头,CacheInterceptor管理缓存策略,ConnectInterceptor负责连接服务端。介绍了它们的逻辑流程和OkHttp如何通过这些拦截器实现请求处理和优化性能。
摘要由CSDN通过智能技术生成

while (true) {
if (canceled) {
streamAllocation.release();
throw new IOException(“Canceled”);
}
Response response;
boolean releaseConnection = true;
try {
//1.调用下一个拦截器
response = realChain.proceed(request, streamAllocation, null, null);
releaseConnection = false;
} catch (RouteException e) {
// 失败后尝试重新发送请求
if (!recover(e.getLastConnectException(), transmitter, false, request)) {
throw e.getFirstConnectException();
}
continue;
} catch (IOException e) {
// 失败后尝试重新发送请求
boolean requestSendStarted = !(e instanceof ConnectionShutdownException);
if (!recover(e, transmitter, requestSendStarted, request)) throw e;
continue;
}
//…
//2.检测response是否合法
Request followUp = followUpRequest(response);
if (followUp == null) {
if (!forWebSocket) {
streamAllocation.release();
}
//3.返回response,请求完成
return response;
}
//最多尝试20次
if (++followUpCount > MAX_FOLLOW_UPS) {
streamAllocation.release();
throw new ProtocolException("Too many follow-up requests: " + followUpCount);
}
//4.重新设置请求
request = followUp;
priorResponse = response;
}
}

在RetryAndFollowUpInterceptor中我们可以看到请求的重试是由一个无限循环保持的,同时在代码里还限制了请求的次数,最多尝试20次。RetryAndFollowUpInterceptor的具体逻辑是:

  1. 开启循环,继续调用下一个拦截器直到返回结果;
  2. 当请求内部抛出异常时,判定是否需要重试;如果符合重试条件,则重新发送请求;
  3. 通过followUpRequest()方法检查response是否合法,检查逻辑是根据HTTP返回码检测(具体逻辑可以查看通过followUpRequest()方法)。如果合法followUp为null,则返回结果,否则进行下一步;
  4. 重新设置request,设置response(用于接下来重新构造response),执行第1步。
BridgeInterceptor

我们看看BridgeInterceptor做了哪些事。

public Response intercept(Chain chain) throws IOException {
Request userRequest = chain.request();
Request.Builder requestBuilder = userRequest.newBuilder();
RequestBody body = userRequest.body();
if (body != null) {
MediaType contentType = body.contentType();
if (contentType != null) {
requestBuilder.header(“Content-Type”, contentType.toString());
}
long contentLength = body.contentLength();
if (contentLength != -1) {
requestBuilder.header(“Content-Length”, Long.toString(contentLength));
requestBuilder.removeHeader(“Transfer-Encoding”);
} else {
requestBuilder.header(“Transfer-Encoding”, “chunked”);
requestBuilder.removeHeader(“Content-Length”);
}
}

if (userRequest.header(“Host”) == null) {
requestBuilder.header(“Host”, hostHeader(userRequest.url(), false));
}

if (userRequest.header(“Connection”) == null) {
requestBuilder.header(“Connection”, “Keep-Alive”);
}
boolean transparentGzip = false;
if (userRequest.header(“Accept-Encoding”) == null && userRequest.header(“Range”) == null) {
transparentGzip = true;
requestBuilder.header(“Accept-Encoding”, “gzip”);
}
List cookies = cookieJar.loadForRequest(userRequest.url());
if (!cookies.isEmpty()) {
requestBuilder.header(“Cookie”, cookieHeader(cookies));
}

if (userRequest.header(“User-Agent”) == null) {
requestBuilder.header(“User-Agent”, Version.userAgent());
}
Response networkResponse = chain.proceed(requestBuilder.build());
HttpHeaders.receiveHeaders(cookieJar, userRequest.url(), networkResponse.headers());
Response.Builder responseBuilder = networkResponse.newBuilder()
.request(userRequest);
if (transparentGzip
&& “gzip”.equalsIgnoreCase(networkResponse.header(“Content-Encoding”))
&& HttpHeaders.hasBody(networkResponse)) {
GzipSource responseBody = new GzipSource(networkResponse.body().source());
Headers strippedHeaders = networkResponse.headers().newBuilder()
.removeAll(“Content-Encoding”)
.removeAll(“Content-Length”)
.build();
responseBuilder.headers(strippedHeaders);
String contentType = networkResponse.header(“Content-Type”);
responseBuilder.body(new RealResponseBody(contentType, -1L, Okio.buffer(responseBody)));
}
return responseBuilder.build();
}

从代码里可以看到,在BridgeInterceptor中出了HTTP的请求头,设置了请求头的各种参数,比如:Content-Type、Connection、User-Agent、GZIP等。

CacheInterceptor

缓存拦截器主要是处理HTTP请求缓存的,通过缓存拦截器可以有效的使用缓存减少网络请求。

public Response intercept(Chain chain) throws IOException {
Response cacheCandidate = cache != null? cache.get(chain.request()): null;//1.取缓存
long now = System.currentTimeMillis();
CacheStrategy strategy = new CacheStrategy.Factory(now, chain.request(), cacheCandidate).get(); //2.验证缓存
Request networkRequest = strategy.networkRequest;
Response cacheResponse = strategy.cacheResponse; //获取缓存

if (cache != null) {
cache.trackResponse(strategy);
}
// If we’re forbidden from using the network and the cache is insufficient, fail.
//这里表示禁止使用缓存
if (networkRequest == null && cacheResponse == null) {
return new Response.Builder()
.request(chain.request())
.protocol(Protocol.HTTP_1_1)
.code(504)
.message(“Unsatisfiable Request (only-if-cached)”)
.body(Util.EMPTY_RESPONSE)
.sentRequestAtMillis(-1L)
.receivedResponseAtMillis(System.currentTimeMillis())
.build();
}

// If we don’t need the network, we’re done.
//3.直接返回缓存
if (networkRequest == null) {
return cacheResponse.newBuilder()
.cacheResponse(stripBody(cacheResponse))
.build();
}
Response networkResponse = null;
try {
//4.没有缓存,执行下一个拦截器
networkResponse = chain.proceed(networkRequest);
}

// If we have a cache response too, then we’re doing a conditional get.
if (cacheResponse != null) {
if (networkResponse.code() == HTTP_NOT_MODIFIED) {
Response response = cacheResponse.newBuilder()
.headers(combine(cacheResponse.headers(), networkResponse.headers()))
.sentRequestAtMillis(networkResponse.sentRequestAtMillis())
.receivedResponseAtMillis(networkResponse.receivedResponseAtMillis())
.cacheResponse(stripBody(cacheResponse))
.networkResponse(stripBody(networkResponse))
.build();
networkResponse.body().close();

// Update the cache after combining headers but before stripping the
// Content-Encoding header (as performed by initContentStream()).
cache.trackConditionalCacheHit();
//5.更新缓存
cache.update(cacheResponse, response);
return response;
} else {
closeQuietly(cacheResponse.body());
}
}
//…
if (cache != null) {
if (HttpHeaders.hasBody(response) && CacheStrategy.isCacheable(response, networkRequest)) {
// Offer this request to the cache.
//6.保存缓存
CacheRequest cacheRequest = cache.put(response);
return cacheWritingResponse(cacheRequest, response);
}
}
return response;
}

在上面的代码中可以看到,OkHttp首先会取出缓存,然后经过验证处理判断缓存是否可用。流程如下:

  1. 根据请求(以Request为键值)取出缓存;
  2. 验证缓存是否可用?可用,则直接返回缓存,否则进行下一步;
  3. 继续执行下一个拦截器,直到但会结果;
  4. 如果之前有缓存,则更新缓存,否则新增缓存。

缓存拦截器主要的工作就是处理缓存,知道了大致流程后,我们接下来分析一下OkHttp是如何管理缓存的。首先我们分析缓存如何获取,在代码中可以看到通过cache.get()得到,我们直接跟代码看。

final InternalCache internalCache = new InternalCache() {
@Override public Response get(Request request) throws IOException {
return Cache.this.get(request);
}

@Override public CacheRequest put(Response response) throws IOException {
return Cache.this.put(response);
}

@Override public void remove(Request request) throws IOException {
Cache.this.remove(request);
}

@Override public void update(Response cached, Response network) {
Cache.this.update(cached, network);
}

@Override public void trackConditionalCacheHit() {
Cache.this.trackConditionalCacheHit();
}

@Override public void trackResponse(CacheStrategy cacheStrategy) {
Cache.this.trackResponse(cacheStrategy);
}
};

可以看到,缓存是通过InternalCache管理的,而InternalCache是Cache的内部了类,InternalCache又调用了Cache的方法。我们这里只分析一个get()方法。

@Nullable Response get(Request request) {
String key = key(request.url());
DiskLruCache.Snapshot snapshot;
Entry entry;
try {
snapshot = cache.get(key);
if (snapshot == null) {
return null;
}
} catch (IOException e) {
return null;
}
try {
entry = new Entry(snapshot.getSource(ENTRY_METADATA));
} catch (IOException e) {
Util.closeQuietly(snapshot);
return null;
}
Response response = entry.response(snapshot);
//…
return response;
}

可以看到,缓存是通过DiskLruCache管理,那么不难看出OkHttp的缓存使用了LRU算法管理缓存。接下来,我们分析下OkHttp如何验证缓存。

在上面的代码中,缓存最终来自于CacheStrategy。我们直接分析下那里的代码。

private CacheStrategy getCandidate() {
// No cached response.
if (cacheResponse == null) {
//1.没有缓存,直接返回没有缓存
return new CacheStrategy(request, null);
}

if (request.isHttps() && cacheResponse.handshake() == null) {
//2.没有进行TLS握手,直接返回没有缓存
return new CacheStrategy(request, null);
}

if (!isCacheable(cacheResponse, request)) {
//3.判断是否是可用缓存。这里是根据cache-control的属性配置来判断的
return new CacheStrategy(request, null);
}

CacheControl requestCaching = request.cacheControl();
if (requestCaching.noCache() || hasConditions(request)) {
//4.cache-control:no-cache不接受缓存的资源;根据请求头的"If-Modified-Since"或者"If-None-Match"判断,这两个属性需要到服务端验证后才能判断是否使用缓存,所以这里先不使用缓存
return new CacheStrategy(request, null);
}

CacheControl responseCaching = cacheResponse.cacheControl();
if (responseCaching.immutable()) {
//5.cache-control:imutable 表示响应正文不会随时间而改变,这里直接使用缓存
return new CacheStrategy(null, cacheResponse);
}

long ageMillis = cacheResponseAge();
long freshMillis = computeFreshnessLifetime();

if (requestCaching.maxAgeSeconds() != -1) {
freshMillis = Math.min(freshMillis, SECONDS.toMillis(requestCaching.maxAgeSeconds()));
}

long minFreshMillis = 0;
if (requestCaching.minFreshSeconds() != -1) {
minFreshMillis = SECONDS.toMillis(requestCaching.minFreshSeconds());
}

long maxStaleMillis = 0;
if (!responseCaching.mustRevalidate() && requestCaching.maxStaleSeconds() != -1) {
maxStaleMillis = SECONDS.toMillis(requestCaching.maxStaleSeconds());
}

if (!responseCaching.noCache() && ageMillis + minFreshMillis < freshMillis + maxStaleMillis) {
Response.Builder builder = cacheResponse.newBuilder();
if (ageMillis + minFreshMillis >= freshMillis) {
builder.addHeader(“Warning”, “110 HttpURLConnection “Response is stale””);
}
long oneDayMillis = 24 * 60 * 60 * 1000L;
if (ageMillis > oneDayMillis && isFreshnessLifetimeHeuristic()) {
builder.addHeader(“Warning”, “113 HttpURLConnection “Heuristic expiration””);
}
//6.这里根据时间计算缓存是否过期,如果不过期就使用缓存
return new CacheStrategy(null, builder.build());
}

String conditionName;
String conditionValue;
if (etag != null) {
conditionName = “If-None-Match”;
conditionValue = etag;
} else if (lastModified != null) {
conditionName = “If-Modified-Since”;
conditionValue = lastModifiedString;
} else if (servedDate != null) {
conditionName = “If-Modified-Since”;
conditionValue = servedDateString;
} else {
//7.没有缓存验证条件,需要请求服务端
return new CacheStrategy(request, null); // No condition! Make a regular request.
}

Headers.Builder conditionalRequestHeaders = request.headers().newBuilder();
Internal.instance.addLenient(conditionalRequestHeaders, conditionName, conditionValue);

Request conditionalRequest = request.newBuilder()
.headers(conditionalRequestHeaders.build())
.build();
//8.这里将上面的验证条件加入请求头,继续向服务端发起请求
return new CacheStrategy(conditionalRequest, cacheResponse);
}

从上面的代码可以看到,OkHttp经过很多判断才能确定是否使用缓存。判断过程可以总结为:

  1. 没有缓存,直接返回没有缓存.
  2. HTTPS没有进行TLS握手,直接返回没有缓存.
  3. 判断是否是可用缓存。这里是根据cache-control的属性配置来判断的.
  4. cache-control:no-cache不接受缓存的资源;根据请求头的"If-Modified-Since"或者"If-None-Match"判断,这两个属性需要到服务端验证后才能判断是否使用缓存,所以这里先不使用缓存.
  5. cache-control:imutable 表示响应正文不会随时间而改变,这里直接使用缓存
  6. 这里根据时间计算缓存是否过期,如果不过期就使用缓存
  7. 没有缓存验证条件,需要请求服务端
  8. 将上面的验证条件(“If-None-Match”,“If-Modified-Since”)加入请求头,继续向服务端发起请求

在上面的验证过程中主要通过Cache-Control中的属性判断缓存是否可用,如果可用则直接返回缓存,否则像服务端继续发送请求判断缓存是否过期。

ConnectInterceptor

ConnectInterceptor的作用就是建立一个与服务端的连接。

public Response intercept(Chain chain) throws IOException {
RealInterceptorChain realChain = (RealInterceptorChain) chain;
Request request = realChain.request();
StreamAllocation streamAllocation = realChain.streamAllocation();
boolean doExtensiveHealthChecks = !request.method().equals(“GET”);
HttpCodec httpCodec = streamAllocation.newStream(client, chain, doExtensiveHealthChecks);
RealConnection connection = streamAllocation.connection();

return realChain.proceed(request, streamAllocation, httpCodec, connection);
}

在上面的代码中,可以看到连接来自于StreamAllocation的newStream()方法。

public HttpCodec newStream(
OkHttpClient client, Interceptor.Chain chain, boolean doExtensiveHealthChecks) {
int connectTimeout = chain.connectTimeoutMillis();
int readTimeout = chain.readTimeoutMillis();
int writeTimeout = chain.writeTimeoutMillis();
boolean connectionRetryEnabled = client.retryOnConnectionFailure();

try {
RealConnection resultConnection = findHealthyConnection(connectTimeout, readTimeout,
writeTimeout, connectionRetryEnabled, doExtensiveHealthChecks);
HttpCodec resultCodec = resultConnection.newCodec(client, chain, this);

synchronized (connectionPool) {
codec = resultCodec;
return resultCodec;
}
} catch (IOException e) {
throw new RouteException(e);
}
}

可以看到在newStream()方法中会继续寻找连接。我们继续分析代码可以看到,OkHttp的连接是维护在一个连接池中的。

private RealConnection findConnection(int connectTimeout, int readTimeout, int writeTimeout,
boolean connectionRetryEnabled) throws IOException {
boolean foundPooledConnection = false;
RealConnection result = null;
Route selectedRoute = null;
Connection releasedConnection;
Socket toClose;
synchronized (connectionPool) {
if (released) throw new IllegalStateException(“released”);
if (codec != null) throw new IllegalStateException(“codec != null”);
if (canceled) throw new IOException(“Canceled”);

// Attempt to use an already-allocated connection. We need to be careful here because our
// already-allocated connection may have been restricted from creating new streams.
releasedConnection = this.connection;
toClose = releaseIfNoNewStreams();
if (this.connection != null) {
// We had an already-allocated connection and it’s good.
result = this.connection;
releasedConnection = null;
}
if (!reportedAcquired) {
// If the connection was never reported acquired, don’t report it as released!
releasedConnection = null;
}

if (result == null) {
// Attempt to get a connection from the pool.
Internal.instance.get(connectionPool, address, this, null);
if (connection != null) {
foundPooledConnection = true;
result = connection;
} else {
selectedRoute = route;
}
}
}
closeQuietly(toClose);

if (releasedConnection != null) {
eventListener.connectionReleased(call, releasedConnection);
}
if (foundPooledConnection) {
eventListener.connectionAcquired(call, result);
}
if (result != null) {
// If we found an already-allocated or pooled connection, we’re done.
return result;
}

// If we need a route selection, make one. This is a blocking operation.
boolean newRouteSelection = false;
if (selectedRoute == null && (routeSelection == null || !routeSelection.hasNext())) {
newRouteSelection = true;
routeSelection = routeSelector.next();
}

synchronized (connectionPool) {
if (canceled) throw new IOException(“Canceled”);

if (newRouteSelection) {
// Now that we have a set of IP addresses, make another attempt at getting a connection from
// the pool. This could match due to connection coalescing.
List routes = routeSelection.getAll();
for (int i = 0, size = routes.size(); i < size; i++) {
Route route = routes.get(i);
Internal.instance.get(connectionPool, address, this, route);
if (connection != null) {
foundPooledConnection = true;
result = connection;
this.route = route;
break;
}
}
}

if (!foundPooledConnection) {
if (selectedRoute == null) {
selectedRoute = routeSelection.next();
}

// Create a connection and assign it to this allocation immediately. This makes it possible
// for an asynchronous cancel() to interrupt the handshake we’re about to do.
route = selectedRoute;
refusedStreamCount = 0;
result = new RealConnection(connectionPool, selectedRoute);
acquire(result, false);
}
}

// If we found a pooled connection on the 2nd time around, we’re done.
if (foundPooledConnection) {
eventListener.connectionAcquired(call, result);
return result;
}

// Do TCP + TLS handshakes. This is a blocking operation.
result.connect(
connectTimeout, readTimeout, writeTimeout, connectionRetryEnabled, call, eventListener);
routeDatabase().connected(result.route());

Socket socket = null;
synchronized (connectionPool) {
reportedAcquired = true;

// Pool the connection.
Internal.instance.put(connectionPool, result);

// If another multiplexed connection to the same address was created concurrently, then
// release this connection and acquire that one.
if (result.isMultiplexed()) {
socket = Internal.instance.deduplicate(connectionPool, address, this);
result = connection;
}
}
closeQuietly(socket);

eventListener.connectionAcquired(call, result);
return result;
}

以上是OkHttp获取连接的主要逻辑,方法比较复杂,我们这里总结一下获取连接的流程,具体的细节可以自行查看。

  1. 首先会尝试从连接池中获取一个连接,获取连接的参数是地址。如果获取到连接,则返回,否则进行下一步;
  2. 如果需要选择线路,则继续尝试获取连接。如果获取到连接,则返回,否则进行下一步;
  3. 创建一个新的连接,然后建立与服务端的TCP连接。
  4. 将连接加入连接池。
CallServerInterceptor

CallServerInterceptor是最后一个拦截器,理所当然这个拦截器负责向服务端发送数据。

public Response intercept(Chain chain) throws IOException {
//…
//写入请求头数据
httpCodec.writeRequestHeaders(request);
realChain.eventListener().requestHeadersEnd(realChain.call(), request);
Response.Builder responseBuilder = null;
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数初中级Android工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则近万的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年Android移动开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。

img

img

img

img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Android开发知识点,真正体系化!

由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)

结尾

如何才能让我们在面试中对答如流呢?

答案当然是平时在工作或者学习中多提升自身实力的啦,那如何才能正确的学习,有方向的学习呢?为此我整理了一份Android学习资料路线:

这里是一份BAT大厂面试资料专题包:

好了,今天的分享就到这里,如果你对在面试中遇到的问题,或者刚毕业及工作几年迷茫不知道该如何准备面试并突破现状提升自己,对于自己的未来还不够了解不知道给如何规划。来看看同行们都是如何突破现状,怎么学习的,来吸收他们的面试以及工作经验完善自己的之后的面试计划及职业规划。

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

如果你觉得这些内容对你有帮助,可以扫码获取!!(备注:Android)

结尾

如何才能让我们在面试中对答如流呢?

答案当然是平时在工作或者学习中多提升自身实力的啦,那如何才能正确的学习,有方向的学习呢?为此我整理了一份Android学习资料路线:

[外链图片转存中…(img-xqxPYACu-1713399271133)]

这里是一份BAT大厂面试资料专题包:

[外链图片转存中…(img-g58kKUmX-1713399271133)]

好了,今天的分享就到这里,如果你对在面试中遇到的问题,或者刚毕业及工作几年迷茫不知道该如何准备面试并突破现状提升自己,对于自己的未来还不够了解不知道给如何规划。来看看同行们都是如何突破现状,怎么学习的,来吸收他们的面试以及工作经验完善自己的之后的面试计划及职业规划。

《互联网大厂面试真题解析、进阶开发核心学习笔记、全套讲解视频、实战项目源码讲义》点击传送门即可获取!

  • 25
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
OkHttp 是一个开源的 HTTP 客户端,用于 Android 平台和 Java 应用。它建立在 Java 的 HttpURLConnection 类之上,并提供了更简洁、更强大的 API。 OkHttp工作原理主要涉及以下几个关键组件: 1. `OkHttpClient`:这是 OkHttp 的核心类,负责配置和创建请求、设置拦截器、管理连接池等。你可以通过构建 OkHttpClient 实例来自定义请求的行为和参数。 2. `Request`:表示一个 HTTP 请求,包括 URL、请求方法(如 GET、POST)、请求体、请求头等信息。你可以通过 Request.Builder 构建一个 Request 实例。 3. `Response`:表示一个 HTTP 响应,包括响应码、响应体、响应头等信息。OkHttp 会将服务器返回的数据解析成 Response 对象。 4. `Interceptor`:拦截器用于在发送请求和接收响应之前进行一些额外的处理。OkHttp 提供了很多内置的拦截器,如重试拦截器、缓存拦截器等,同时也支持自定义拦截器。 5. `Dispatcher`:调度器负责管理请求的调度和执行。它可以控制同时并发执行的请求数量,还可以设置请求超时时间等。 6. `ConnectionPool`:连接池用于管理 HTTP 连接的复用和回收。OkHttp 会自动复用连接以减少网络延迟,提高性能。 7. `Cache`:缓存可以保存服务器返回的响应,以便在后续的请求中复用。OkHttp 支持对响应进行缓存,并提供了灵活的配置选项。 当你使用 OkHttp 发起一个网络请求时,它会通过 OkHttpClient 来创建一个 Request 对象,并通过 Dispatcher 来执行这个请求。在执行过程中,OkHttp 会根据设置的拦截器进行一系列的处理,如添加请求头、重试、缓存等。最终,OkHttp 将返回一个 Response 对象,你可以从中获取到服务器返回的数据。 总体来说,OkHttp工作原理是通过封装底层的 HttpURLConnection,提供了简洁易用的 API,并通过拦截器和连接池等机制优化了网络请求的性能和可定制性。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值