后端springboot主动推送消息给前端vue

SpringBoot:websocket 实现后端主动前端推送数据 SpringBoot:websocket实现后端主动前端推送数据 阅读详情

1.搭建vue环境并快速构建一个简单的vue项目可以参考这个博客

如何搭建一个vue项目(完整步骤)_a大白的博客-优快云博客_创建vue项目

2.在基础项目上添加websocket连接

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  mounted() {
    this.initWebSocket()
  },
  methods: {
    initWebSocket(){
      console.log('websocket连接了');
      //初始化weosocket
      //这里的wsuri是根据服务端的ip进行配置(开发环境),生产环境的话可以使用上面的Ip或者是nginx做代理
      const wsuri = `ws://localhost:4002/websocket`;      //协议标识符是ws(如果加密,则为wss),服务器网址就是 URL。
      // const wsuri = `ws://${Ip}/ws/${localStorage.getItem('name')}`;
      this.websock = new WebSocket(wsuri);
      this.websock.onmessage = this.websocketonmessage;
      this.websock.onopen = this.websocketonopen;
      this.websock.onerror = this.websocketonerror;
      this.websock.onclose = this.websocketclose;
    },
    websocketsend(){//数据发送
      // let msg=JSON.stringify(111111);
      // this.websock.send(msg);
    },
    websocketonopen(){ //连接建立之后执行send方法发送数据
    },
    websocketonerror(){//连接建立失败重连
      this.initWebSocket();
    },
    websocketonmessage(e){ //数据接收
      console.log(e);
    },
    websocketclose(){  //关闭
      this.websock.close()
    },
  }

}

</script>

其中注意localhost:4002是后端服务地址跟端口号,/websocket是后端@ServerEndpoint的value值

3.后端配置

引入依赖

         <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-websocket</artifactId>
            <version>2.1.0.RELEASE</version>
         </dependency>

新增websocket配置类

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }
}

新增websocket客户端

import java.io.IOException;
import java.util.concurrent.CopyOnWriteArraySet;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@ServerEndpoint(value = "/websocket")
@Component
public class WebSocketServer {
    private final static Logger log = LoggerFactory.getLogger(WebSocketServer.class);

    //静态变量,用来记录当前在线连接数。应该把它设计成线程安全的。
    private static int onlineCount = 0;
    //concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
    private static CopyOnWriteArraySet<WebSocketServer> webSocketSet = new CopyOnWriteArraySet<WebSocketServer>();

    //与某个客户端的连接会话,需要通过它来给客户端发送数据
    private Session session;

    /**
     * 连接建立成功调用的方法
     */
    @OnOpen
    public void onOpen(Session session) {
        this.session = session;
        //加入set中
        webSocketSet.add(this);
        //在线数加1
        addOnlineCount();
        log.info("有新连接加入!当前在线人数为" + getOnlineCount());
        try {
            sendMessage("连接成功");
        } catch (IOException e) {
            log.error("websocket IO异常");
        }
    }

    /**
     * 连接关闭调用的方法
     */
    @OnClose
    public void onClose() {
        //从set中删除
        webSocketSet.remove(this);
        //在线数减1
        subOnlineCount();
        log.info("有一连接关闭!当前在线人数为" + getOnlineCount());
    }

    /**
     * 收到客户端消息后调用的方法
     *
     * @param message 客户端发送过来的消息
     */
    @OnMessage
    public void onMessage(String message, Session session) {
        log.info("来自客户端的消息:" + message);

        //群发消息
        for (WebSocketServer item : webSocketSet) {
            try {
                item.sendMessage(message);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    /**
     * @param session
     * @param error
     */
    @OnError
    public void onError(Session session, Throwable error) {
        log.error("发生错误");
        error.printStackTrace();
    }

    public void sendMessage(String message) throws IOException {
        this.session.getBasicRemote().sendText(message);
    }

    /**
     * 群发自定义消息
     */
    public static void sendInfo(String message) throws IOException {
        log.info(message);
        for (WebSocketServer item : webSocketSet) {
            try {
                item.sendMessage(message);
            } catch (IOException e) {
                continue;
            }
        }
    }

    public static synchronized int getOnlineCount() {
        return onlineCount;
    }

    public static synchronized void addOnlineCount() {
        WebSocketServer.onlineCount++;
    }

    public static synchronized void subOnlineCount() {
        WebSocketServer.onlineCount--;
    }
}

以上全部完成,为了测试,新增一个接口,调用一下即可查看效果

 成功。

springboot整合WebSocket:后台服务主动发送信息给前端客户端 1.前端websocket开启方法 // WebSocket接收消息推送 openSocket() { if (typeof WebSocket == "undefined") { console.log("您的浏览器不支持WebSocket"); } else { var socketUrl = `http://localhost:8080/ws/` + this.user.id; socketUrl = socket 阅读详情

相关推荐

websocket 实现后端主动前端推送数据、及时通讯(vue3 + springboot)

WebSocket 是一种全双工通信协议,用于在 Web 浏览器和服务器之间建立持久的连接。WebSocket 协议由 IETF 定为标准,WebSocket API 由 W3C 定为标准。一旦 Web 客户端与服务器建立连接,之后的全部数据通信都通过这个连接进行。可以互相发送 JSON、XML、HTML 或图片等任意格式的数据。都是基于 TCP 的应用层协议。都使用 Request/Response 模型进行连接的建立。可以在网络中传输数据。

m0_48853274的博客 1万+

websockets-后端主动向前端推送消息

WebSocket协议是基于TCP的一种新的网络协议。它实现了浏览器与服务器全双工(full-duplex)通信,即允许服务器主动发送信息给客户端。因此,在WebSocket中,浏览器和服务器只需要完成一次握手,两者之间就直接可以创建持久性的连接,并进行双向数据传输,客户端和服务器之间的数据交换变得更加简单。

qq_45770147的博客 6245

SSE 实践:用 Vue 和 Spring Boot 实现实时数据传输

SSE 看着有些高级,实际实现一点儿不难,跟着我一起实现吧

xyendjsj的博客 1402

Springboot整合WebSocket实现主动向前端推送消息

在上篇文章tcp编程中,我们实现了C++客户端与java服务器之间的通信,客户端发送了一个消息给服务器,今天我们要实现基于WebSocket实现服务器主动向前端推送消息,并且以服务器接收到C++客户端的消息主动向前端推送消息的触发条件。

m0_61229395的博客 5032

电子发票二维码背后的秘密:10分钟看懂校验码、加密字符含义与防伪设计

本文深入解析电子发票二维码的结构与防伪设计,揭示校验码和加密字符的生成原理及验证方法。通过实际案例和技术细节,帮助财务人员理解电子发票的安全机制,提升防伪识别能力,确保税务合规。

weixin_29248611的博客 528

基于cat12搞定SBM的ROI的统计分析——vertex水平和ROI水平的双样本T检验

前言 一、Atlas皮层图谱介绍 二、SBM分析——主要以皮层四种常用指标中的厚度(thickness)和沟深(depth)为主

Sophia2023的博客 8747

VUE+SpringBoot+Apache2.4实现websocket通讯

需求:实现消息主动推送   后端实现(Spring Boot): 1、引入websocket包 &lt;dependency&gt; &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt; &lt;artifactId&gt;spring-boot-starter-websocket&lt;/artifactId&g...

韩小转的博客 798

UE4/5项目GPU崩溃?可能是Windows的TDR机制在搞鬼!深入浅出聊聊TdrDelay与显卡超时

本文深入探讨了UE4/5项目中GPU崩溃的常见原因,揭示了Windows TDR机制的工作原理及其对渲染进程的影响。通过调整TdrDelay参数和优化GPU负载,提供了解决显卡超时问题的实用方案,帮助开发者提升项目稳定性。

weixin_30691649的博客 409

SpringBoot+Vue集成WebSocket,实现后端向前端推送信息

一、后端 1.pom文件引入依赖 <!-- webSocket--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId> </dependency> 2.编写启用WebSocket支持类 import org.spring.

qq_41622603的博客 4320

CORS(跨域资源共享)漏洞解决方法

最近,测试环境上的项目被360测试人员检测出来有一个CORS漏洞,以下记录下漏洞问题与解决方法。 一、低危漏洞:CORS漏洞问题 测试人员访问某个url,将请求头中的Origin字段修改为任意值,结果仍然能获得正确的响应报文,就说明有CORS漏洞。 当CORS的设置不正确时,就会带来安全问题;当响应头中的Access-Control-Allow-Origin设置为null或*时,表示信任任何域,这时候就可能引入安全问题。 修复方法是合理配置CORS,判断Origin是否合法;具体说就是不让在nginx或t

BHSZZY的博客 3万+

ur3手眼标定+realsenseL515

知乎 csdn

AI_future的博客 978

原来Spring可以这样推送消息到客户端!

SseEmitter是Spring Framework中用于服务器发送事件(Server-Sent Events, SSE)的类。SSE是一种允许服务器主动向客户端推送数据的技术,通常用于实现如实时通知、数据流等功能。其工作原理基于HTTP协议,客户端通过HTTP请求订阅服务器的事件流,服务器则通过SseEmitter对象持续向客户端发送事件。SseEmitter的核心特性单向通信:SSE是单向的,只允许服务器向客户端推送数据,客户端不能通过此通道向服务器发送数据。

m0_50180963的博客 650

组态王|以一定的时间间隔查询某个时间段内的历史数据

使用该函数其他都可以满足,唯一问题是变量的选择,当切换站点后查询历史数据时,所选的变量依然是上次站点查询时所选择的变量,每当更换站点查询时都需要重新选择变量,这一点太繁琐,是用户和操作者无法忍受的。但是由于现场可能数据变化并非太过频繁,想要实现记录频率不变,还是以1分钟一次的频率进行存储,但是报表查询的时候想要只显示整点的数据。其中日历控件的设置与之前的历史数据查询是一样的,报表的抬头设置都是不用变的,此处不再赘述,有兴趣的可以。以上为组态王中以一定的时间间隔查询某个时间段内的历史数据的实现过程。

做有价值的事,积累有价值的笔记! 2542

SpringBoot+WebSocket实时监控异常

点击上方“芋道源码”,选择“设为星标”管她前浪,还是后浪?能浪的浪,才是好浪!每天 10:33更新文章,每天掉亿点点头发...源码精品专栏原创 | Java 2021超神之路,很肝~中文详细注释的开源项目RPC 框架 Dubbo 源码解析网络应用框架 Netty 源码解析消息中间件 RocketMQ 源码解析数据库中间件 Sharding-JDBC 和 MyCAT ...

芋艿V 180

ADS仿真设计平行定向耦合器学习笔记

ADS仿真设计平行定向耦合器

qq_36521926的博客 1万+

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

java vue消息推送_springboot+vue 使用websocket后台主动向前台推送消息

前提本篇文章适用于入门级别,不做深入研究。后台springboot代码引入依赖org.springframework.bootspring-boot-starter-websocket配置类@Configurationpublic class CommonConfig {/*** websocket配置* @return*/@Beanpublic ServerEndpointExporter se...

weixin_36403128的博客 1323

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

前后端分离项目,使用websocket后端推送消息给前端

最近有个需求是后端主动推送消息给前端,通过一番艰难险阻总算是给完成了,选择使用的是websocket,可以前后端进行通信 1、框架: 后端:springboot2.x 前端:vue2.x 2、原理: 后端建立一个websocket服务器,提供一个url,前端通过url与后端websocket服务器进行连接 3、使用的依赖: 在WebSocketConfig中会用到 <dependency&g...

boomxiaolong的博客 1万+

VB摄像头监控

该VB模块可对摄像头捕获的画面进行录像等,可在创建的窗口进行控制

WebSocket + SpringBoot + VUE实现后端实时向前端推送消息

一、目的 众所周知,正常来说在前后端通信中,后端往往处于一个被动的状态,对前端的请求作出对应的响应。但有的时候我们会遇到需要后端前前端推送数据的需求,比如消息、邮件等的推送。这个时候,实现的一种方式是使用webSocket,在前后端之间建立唯一的通信连接。 二、小知识 1.WebSocket连接用的是ws,而不是http 2.WebSocket在连接期间是一直保留的 三、核心代码 1.后端依赖 <dependency> <groupId>io.

qq_37820460的博客 4518

SpringBoot整合SSE,实现后端主动推送DEMO

说起服务端主动推送,大家第一个想到的一定是WEBSOCKET。作为软件工程师,不能无脑使用一种技术,要结合实际情况,择优选取。SSE(Server-Sent Events)相比于WEBSOCKET1、轻量化、兼容性 基于传统的HTTP协议,所以浏览器兼容性比较好2、 只支持单向通讯。(服务器->客户端)

zjy660358的专栏 2420

Springboot Vue WebSocket实现后端服务推送通知功能

Springboot Vue WebSocket实现后端服务推送通知功能一、业务场景二、实现过程1. Springboot pom.xml引入WebSocket依赖jar包2. 编写WebSocketConfig配置类3. 编写WebSocketServer服务实现类 一、业务场景 最近在做一个功能,业务待办事件数量实时推送给前端页面,最初的设想是在前端定时调用后端接口获取,但是这样就无法实现实时信息,所以,就想到了WebSocket。废话不多说,上菜。。。 二、实现过程 Springboot 和 V

ZwLemon 2101

主动推送数据到前端的SSE技术原理以及如何使用

首先,SSE全称是Server-Sent Events,是一种服务器向客户端单向推送数据的技术。它基于HTTP协议,使用长连接,允许服务器主动发送消息到浏览器。相比WebSocket,SSE更简单,但只支持单向通信,适合服务器向客户端推送实时数据的场景,比如实时通知、股票行情等。Spring MVC提供了对SSE的支持,主要是通过SseEmitter类。需要创建一个Controller,返回SseEmitter对象,然后通过这个对象发送数据。

qq_39126115的博客 1774
上一篇: dto与xml互转(使用jdk的xml注解实现)
下一篇: CRC16 MODBUS 查表法 java实现
programmer_cjl
博客等级 码龄8年 2粉丝 4原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值