python的ConfigParser模块

简介

ConfigParser模块在python3中修改为configparser.这个模块定义了一个ConfigParser类,该类的作用是使用配置文件生效,配置文件的格式和windows的INI文件的格式相同

该模块的作用 就是使用模块中的RawConfigParser()ConfigParser()SafeConfigParser()这三个方法(三者择其一),创建一个对象使用对象的方法对指定的配置文件做增删改查 操作。

配置文件有不同的片段组成和Linux中repo文件中的格式类似:

格式:

[section] 
name=value
或者
name: value
"#"";" 表示注释

[DEFAULT] #设置默认的变量值,初始化
[My Section]
foodir: %(dir)s/whatever
dir=frob
long: this value continues
   in the next line

%(dir)s 会被frob代替。默认值会以字典的形式传递给ConfigParser的构造器。section一般存放的哦内置目录下,如果切换到其他的目录需啊哟指定存放位置。

方法

下面这三种方式使用时,切记注意

在调用这三个函数时,切记这三个函数会将调用optionxform(),在传递键值对数据时,会将键名 全部转化为小写

RawConfigParser()
ConfigParser.RawConfigParser([defaults[, dict_type[, allow_no_value]]]) 

defaults : 如果指定默认值,则使用默认值的键值对
dict_type:使用新的section的键值对
allow_no_value :默认是False,如果是True,表示可以接收空值(Nonereturn:对象

不支持可变参数,在section中不能存在%()s

ConfigParser()
ConfigParser.ConfigParser([defaults[, dict_type[, allow_no_value]]]) 

在default中必须出现%()s

SafeConfigParser()
 ConfigParser.SafeConfigParser([defaults[, dict_type[, allow_no_value]]]) 

更加智能化,在section中是否存在%()s会自动判断

传递参数使用函数optionxform(),foo %(bar)s 和 foo %(BAR)s是相同的,optionxform()会将大写字母全部转换为小写。

常见异常

异常描述
ConfigParser.Error所有异常的基类
ConfigParser.NoSectionError指定的section没有找到
ConfigParser.DuplicateSectionError调用add_section() 时,section名称已经被使用
ConfigParser.NoOptionError指定的参数没有找到
ConfigParser.InterpolationError当执行字符串插值时出现问题时,出现异常的基类
ConfigParser.InterpolationDepthError当字符串插值无法完成时,因为迭代次数超过了最大的范围,所以无法完成。InterpolationError的子类
InterpolationMissingOptionError当引用的选项不存在时,会出现异常。InterpolationError的子类
ConfigParser.InterpolationSyntaxError当产生替换的源文本不符合所需的语法时,就会出现异常。InterpolationError的子类。
ConfigParser.MissingSectionHeaderError当试图解析一个没有分段标题的文件时,会出现异常。
ConfigParser.ParsingError当试图解析文件时发生错误时,会出现异常
ConfigParser.MAX_INTERPOLATION_DEPTH当raw参数为false时,get()的递归插值的最大深度。这只适用于ConfigParser类

RawConfigParser 对象

对象的操作可以分为两大类,一种是对配置文件的操作,另一种是对读取后数据流的操作。

对配置文件的操作

读取配置文件

方法描述
read(filenames)filesnames是一个列表,需要从文件加载初始值的应用程序应该在调用read()之前使用readfp()加载所需的文件或文件。
readfp(fp[, filename])在fp中,从文件或文件类对象中读取和解析配置数据(只使用readline()方法)。如果文件名被省略,并且fp有一个name属性,它被用于文件名;默认值为< ? >。

写入配置文件

方法描述
write(fileobject)将配置的表示写入指定的文件对象。这个表示可以由未来的read()调用解析。
对内存中数据流的操作

增加配置文件中的值

方法描述
add_section(section)向实例添加一个section

删除配置文件中的值

方法描述
remove_option(section, option)从指定的部分中删除指定的选项。如果该部分不存在,请提出NoSectionError。如果存在的选项被删除,返回True;否则返回False。
remove_section(section)从配置中删除指定的section。如果这个部分确实存在,返回True。否则返回假

修改配置文件中的值

方法描述
set(section, option, value)如果给定的部分存在,将给定的选项设置为指定的值
optionxform(option)也可以在一个实例上重新设置它,对于一个需要字符串参数的函数。例如,将其设置为str,将使选项名称区分大小写

查找配置文件中的值

方法描述
defaults()返回包含实例范围默认值的字典。
sections()返回可用的section的列表;默认section不包括在列表中
has_section(section)指示指定的section是否出现在配置中。默认的section未被确认
options(section)返回指定section中可用的选项列表。
has_option(section, option)如果给定的section存在,并且包含给定的选项,则返回True;否则返回False
get(section, option)为指定的section获取一个选项值。
getint(section, option)它将指定section中的选项强制转换为整数
getfloat(section, option)它将指定section中的选项强制转换为浮点型
getboolean(section, option)强制转换为布尔型,”1”, “yes”, “true”, and “on”, 转换为True,”0”, “no”, “false”, and “off”, 转换为Falseo 其他返回ValueError.
items(section)返回给定section中每个选项的(name,value)对的列表。
方法描述
import ConfigParser, os

config = ConfigParser.ConfigParser()
config.readfp(open('defaults.cfg'))
config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')])
cfgparser = ConfigParser()
...
cfgparser.optionxform = str

ConfigParser对象

SafeConfigParser中包含ConfigParser相同的方法,还有一部分增加的方法

方法描述
get(section, option[, raw[, vars]])为指定的section获取一个选项值。如果提供了vars,它必须是一个字典。该选项在vars(如果提供)、分段和默认值中查找,
items(section[, raw[, vars]])返回给定section中每个选项的(名称、值)对的列表

所有的“%”插值都在返回值中展开,除非原始的参数是真的。内插键的值与选项相同

SafeConfigParser对象

set(section, option, value)
如果给定的部分存在,将给定的选项设置为指定的值;否则提高NoSectionError。值必须是字符串(str或unicode);如果没有,则会出现类型错误

实例

实例一:写配置文件
import ConfigParser

config = ConfigParser.RawConfigParser()

# When adding sections or items, add them in the reverse order of
# how you want them to be displayed in the actual file.
# In addition, please note that using RawConfigParser's and the raw
# mode of ConfigParser's respective set functions, you can assign
# non-string values to keys internally, but will receive an error
# when attempting to write to a file or when you get it in non-raw
# mode. SafeConfigParser does not allow such assignments to take place.
config.add_section('Section1')
config.set('Section1', 'an_int', '15')
config.set('Section1', 'a_bool', 'true')
config.set('Section1', 'a_float', '3.1415')
config.set('Section1', 'baz', 'fun')
config.set('Section1', 'bar', 'Python')
config.set('Section1', 'foo', '%(bar)s is %(baz)s!')

# Writing our configuration file to 'example.cfg'
with open('example.cfg', 'wb') as configfile:
    config.write(configfile)
实例二:读配置文件
import ConfigParser

config = ConfigParser.RawConfigParser()
config.read('example.cfg')

# getfloat() raises an exception if the value is not a float
# getint() and getboolean() also do this for their respective types
a_float = config.getfloat('Section1', 'a_float')
an_int = config.getint('Section1', 'an_int')
print a_float + an_int

# Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.
# This is because we are using a RawConfigParser().
if config.getboolean('Section1', 'a_bool'):
    print config.get('Section1', 'foo')
实例三:获取插入值
import ConfigParser

config = ConfigParser.ConfigParser()
config.read('example.cfg')

# Set the third, optional argument of get to 1 if you wish to use raw mode.
print config.get('Section1', 'foo', 0)  # -> "Python is fun!"
print config.get('Section1', 'foo', 1)  # -> "%(bar)s is %(baz)s!"

# The optional fourth argument is a dict with members that will take
# precedence in interpolation.
print config.get('Section1', 'foo', 0, {'bar': 'Documentation',
                                        'baz': 'evil'})
实例四:默认值

所有三种类型的config分析器都可以使用默认值。如果在其他地方没有定义一个选项,那么它们就被用于插值

import ConfigParser

# New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each
config = ConfigParser.SafeConfigParser({'bar': 'Life', 'baz': 'hard'})
config.read('example.cfg')

print config.get('Section1', 'foo')  # -> "Python is fun!"
config.remove_option('Section1', 'bar')
config.remove_option('Section1', 'baz')
print config.get('Section1', 'foo')  # -> "Life is hard!"
实例五:在各section之间移动选项
def opt_move(config, section1, section2, option):
    try:
        config.set(section2, option, config.get(section1, option, 1))
    except ConfigParser.NoSectionError:
        # Create non-existent section
        config.add_section(section2)
        opt_move(config, section1, section2, option)
    else:
        config.remove_option(section1, option)
实例六:配置文件中有空值

一些配置文件包含了没有值的设置,但是它与ConfigParser支持的语法相一致。对构造函数的不允许值参数可以被用来表示应该接受这样的值

>>> import ConfigParser
>>> import io

>>> sample_config = """
... [mysqld]
... user = mysql
... pid-file = /var/run/mysqld/mysqld.pid
... skip-external-locking
... old_passwords = 1
... skip-bdb
... skip-innodb
... """
>>> config = ConfigParser.RawConfigParser(allow_no_value=True)
>>> config.readfp(io.BytesIO(sample_config))

>>> # Settings with values are treated as before:
>>> config.get("mysqld", "user")
'mysql'

>>> # Settings without values provide None:
>>> config.get("mysqld", "skip-bdb")

>>> # Settings which aren't specified still raise an error:
>>> config.get("mysqld", "does-not-exist")
Traceback (most recent call last):
  ...
ConfigParser.NoOptionError: No option 'does-not-exist' in section: 'mysqld'
# -*- coding: utf-8 -*- from kafka import KafkaConsumer from datetime import datetime import json import redis import configparser # 设置Kafka消费者 #consumer = KafkaConsumer('m2m-alarm', bootstrap_servers=['10.104.170.4:9092'],auto_offset_reset='earliest') consumer = KafkaConsumer('m2m-alarm', bootstrap_servers=['10.104.170.4:9092']) #设置redis信息 redisPool = redis.ConnectionPool(host='211.136.203.185', port=22022,decode_responses=True,encoding='GBK') redis_client = redis.Redis(connection_pool=redisPool) Warnkey='CDNWARN' #设置打印labelValue标识 LabelValueTrue=['bandwidthBillFlowDifPtg','countryBwBillFlowDifPtg','billFlowDifPtg','mfs_status','opStatFlowDifPtg','bandwidthOpStatFlowDifPtg','opStat5mFlowDifPtg','countryOpStat5mFlowDifPtg','countryBwOfflineOpFlowDifPtg','telnet','custBillFlowDifPtg','errorRecordsPtg','ceres_trans_obstime'] def send_message(message): # 创建ConfigParser对象 config = configparser.ConfigParser() # 读取配置文件 config.read('config.ini') # 获取配置项的值 Blackkeywords = config.get('black', 'blackkeywords') Blackkeywordkey1= config.get('blacklist', 'list1') Blackkeywordkey2= config.get('blacklist', 'list2') Blackkeywords_list = Blackkeywords.split(',') Blackkeywords_list1 = Blackkeywordkey1.split(',') Blackkeywords_list2 = Blackkeywordkey2.split(',') ifhit= any(value in message for value in Blackkeywords_list) ifhis1 =any(value in message for value in Blackkeywords_list1) ifhis2 =any(value in message for value in Blackkeywords_list2) # 检查字符串中是否包含子字符串 if ifhit or (ifhis1 and ifhis2): print (message,"命中屏蔽,不发送告警微信") else: print (message,"未命中屏蔽,发送告警微信") redis_client.lpush(Warnkey,warnmessage) # 消费数据 for message in consumer: try: # 解析JSON数据 data = json.loads(message.value.decode('utf-8')) if data['type'] == 1:
03-13
<think>好的,我现在要解决的问题是如何使用Python从Kafka消费消息,然后通过Redis发送告警信息,同时根据配置文件中的黑名单关键字来决定是否发送告警。用户还提到需要用到configparser来读取配置文件进行黑白名单过滤。我需要一步步思考怎么实现这个需求。 首先,我需要明确整个流程的大致步骤。大概分为以下几个部分: 1. 读取配置文件,获取Kafka和Redis的连接配置,以及黑名单关键字。 2. 连接Kafka消费者,订阅相关主题并消费消息。 3. 对每条消息进行黑名单过滤,检查是否包含关键字。 4. 如果消息需要告警,则将告警信息存储到Redis中,或者通过Redis的发布订阅机制发送通知。 5. 处理可能的异常情况,比如配置文件中缺少必要的字段,或者连接失败等。 接下来,我需要考虑每个步骤的具体实现方法。 首先是读取配置文件。用户提到了configparser模块,我需要使用它来读取INI格式的配置文件。配置文件可能包含Kafka的地址、主题,Redis的主机、端口、数据库,以及黑名单的关键字列表。例如,配置文件可能的结构如下: [Kafka] bootstrap_servers = localhost:9092 topic = alerts [Redis] host = localhost port = 6379 db = 0 [Filter] blacklist = error,failure,outage 读取这些配置的时候需要注意,黑名单可能是一个逗号分隔的字符串,需要转换成列表。同时,要处理可能的异常,比如没有找到对应的section或option,这时候需要捕获configparser.NoSectionError或NoOptionError,并给出友好的提示或者默认值。例如,用户提供的引用[2]中提到使用绝对路径来读取配置文件,避免路径问题,这需要确保配置文件的位置正确。 接下来是连接KafkaConsumer。需要使用kafka-python库中的KafkaConsumer类。需要传入bootstrap_servers和topic,可能还需要设置消费者组group_id。然后循环消费消息,对每条消息进行处理。 然后是过滤消息。对于每条消息,需要检查其内容是否包含黑名单中的任何一个关键字。如果包含,则不发送告警;如果不包含,则发送。这里需要注意的是,黑名单过滤的逻辑是:如果消息包含任何黑名单中的关键字,则跳过,否则发送。或者用户的需求可能是相反的,可能黑名单是阻止发送,而白名单是允许发送,需要明确。根据用户的问题描述,是“根据配置文件中的黑名单关键字决定是否发送告警”,也就是当消息中包含黑名单中的关键字时,不发送告警。因此,如果消息内容包含任何一个黑名单中的词,就过滤掉,否则发送。 然后是处理告警,将信息发送到Redis。这里有两种可能的方式:一种是将告警信息存储到Redis的某个数据结构中,比如列表或者有序集合,另一种是通过Redis的发布订阅功能,发布到一个频道,让订阅者处理。用户的问题中提到“通过Redis发送告警信息”,可能指的是后者,即使用Redis的pub/sub机制。或者也可能是将告警信息存入Redis,供其他服务读取。需要进一步明确。假设用户希望将告警信息存储到Redis的一个列表中,或者发布到特定频道。 接下来,需要连接Redis,使用redis-py库。读取配置中的host、port、db,然后创建StrictRedis实例。 在代码结构上,可能的步骤是: 1. 读取配置文件,获取所有必要的参数。 2. 初始化KafkaConsumer和Redis连接。 3. 消费消息,过滤,发送到Redis。 另外需要考虑异常处理,比如Kafka连接失败,Redis连接失败,配置项缺失等。例如,当读取配置文件时,如果某个section不存在,configparser会抛出NoSectionError,这时需要捕获并处理,可能记录错误日志并退出程序。 现在,具体实现细节: 配置文件的结构需要明确。比如,假设配置文件config.ini的结构如下: [Kafka] bootstrap_servers = localhost:9092 topic = alerts group_id = alert_consumer [Redis] host = localhost port = 6379 db = 0 alert_channel = alerts_channel [Filter] blacklist = error,fatal,outage 读取配置时,使用configparser读取各个字段。比如: - Kafka的bootstrap_servers应该是一个逗号分隔的字符串,可能多个broker地址。 - topic是消费的主题。 - group_id是消费者组ID,可选,但最好设置,以便管理偏移量。 - Redis部分需要host、port、db,以及可能存储告警的键名或者频道名。 - Filter的blacklist是逗号分隔的关键字列表。 然后,初始化KafkaConsumer: from kafka import KafkaConsumer consumer = KafkaConsumer( config['topic'], bootstrap_servers=config['bootstrap_servers'].split(','), group_id=config.get('group_id', 'default_group') # 如果配置中没有,使用默认 ) 对于Redis: import redis redis_conn = redis.Redis( host=config['host'], port=config.getint('port'), db=config.getint('db') ) 如果配置中有alert_channel,可以使用pubsub: channel = config.get('alert_channel', 'alerts') redis_conn.publish(channel, message) 或者将告警信息存储到某个列表: redis_key = config.get('alert_list_key', 'alerts_list') redis_conn.lpush(redis_key, message) 具体取决于需求。这里可能需要用户明确,但问题描述中没有具体说明,所以可能需要两种方式都考虑,或者根据常规做法选择。 过滤部分: blacklist = [kw.strip() for kw in config['blacklist'].split(',') if kw.strip()] 对于每条消息,假设消息是字符串格式,检查是否包含任一黑名单关键字: message_value = message.value.decode('utf-8') # 假设消息是bytes类型,需要解码 if any(keyword in message_value for keyword in blacklist): # 包含黑名单关键字,跳过 continue else: # 发送告警到Redis redis_conn.publish(channel, message_value) 或者,如果消息是JSON格式,可能需要解析后检查特定字段。 但用户的问题中没有说明消息的具体格式,所以假设是纯文本。 现在,将这些步骤整合成代码。同时处理可能的异常,比如配置读取错误,连接失败等。 可能的代码结构: import configparser import os from kafka import KafkaConsumer import redis BASE_DIR = os.path.dirname(os.path.abspath(__file__)) config = configparser.ConfigParser() config.read(os.path.join(BASE_DIR, 'config.ini')) # 读取Kafka配置 try: bootstrap_servers = config.get('Kafka', 'bootstrap_servers') topic = config.get('Kafka', 'topic') group_id = config.get('Kafka', 'group_id', fallback='alert_group') except configparser.NoSectionError as e: print(f"配置错误:{e}") exit(1) except configparser.NoOptionError as e: print(f"配置错误:{e}") exit(1) # 读取Redis配置 try: redis_host = config.get('Redis', 'host') redis_port = config.getint('Redis', 'port') redis_db = config.getint('Redis', 'db') alert_channel = config.get('Redis', 'alert_channel', fallback='alerts') except configparser.NoSectionError as e: print(f"配置错误:{e}") exit(1) except configparser.NoOptionError as e: print(f"配置错误:{e}") exit(1) # 读取黑名单 try: blacklist_str = config.get('Filter', 'blacklist') blacklist = [kw.strip() for kw in blacklist_str.split(',') if kw.strip()] except configparser.NoSectionError: blacklist = [] except configparser.NoOptionError: blacklist = [] # 初始化Kafka消费者 consumer = KafkaConsumer( topic, bootstrap_servers=bootstrap_servers.split(','), group_id=group_id, auto_offset_reset='earliest' # 根据需要设置 ) # 初始化Redis连接 redis_conn = redis.Redis(host=redis_host, port=redis_port, db=redis_db) # 消费消息 for message in consumer: try: msg_value = message.value.decode('utf-8') # 检查黑名单 if any(keyword in msg_value for keyword in blacklist): print(f"消息包含黑名单关键字,已过滤: {msg_value}") continue # 发送到Redis redis_conn.publish(alert_channel, msg_value) print(f"已发送告警: {msg_value}") except Exception as e: print(f"处理消息时发生错误: {e}") 这段代码的大致流程就是读取配置,连接Kafka和Redis,然后消费消息,过滤后发送到Redis的发布频道。 需要注意的几个点: 1. 配置文件的路径是否正确,需要确保config.ini位于正确的位置。用户引用[2]中提到使用BASE_DIR来构建绝对路径,避免路径问题。 2. 黑名单的处理,如果配置文件中没有Filter部分或者blacklist选项,则默认黑名单为空列表,即所有消息都发送告警。是否合理?或者应该让用户必须配置?这取决于需求,但根据用户的问题,可能需要黑名单存在,所以如果用户没有配置,可能需要警告或处理。 3. Kafka消费者的参数可能需要更多配置,比如auto_offset_reset,enable_auto_commit等,需要根据实际情况调整。 4. Redis的发布/订阅是否持久化?如果消费者在发送时Redis不可用,是否需要重试?这里可能需要增加重试机制或者异常处理,比如捕获redis.exceptions.ConnectionError并尝试重新连接。 5. 消息解码,假设消息是UTF-8编码,如果不是的话可能会出错,需要处理解码异常。 6. 黑名单的检查是否区分大小写?比如,如果黑名单中有"error",而消息中有"Error",是否会被过滤?这需要明确,可能在代码中将消息和关键字都转为小写,或者保持原样。根据用户需求,此处可能保持原样,即区分大小写。 另外,用户可能需要白名单和黑名单的组合过滤,但问题中只提到黑名单,所以只需处理黑名单。 测试部分也需要考虑,比如发送测试消息到Kafka,查看是否被正确过滤和发送到Redis。 现在,根据这些思考,整理回答的结构: 1. 配置文件的设置,包括Kafka、Redis、Filter部分。 2. 使用configparser读取配置,处理路径和异常。 3. 初始化KafkaConsumer和Redis连接。 4. 消费消息并过滤黑名单关键字。 5. 发送符合条件的消息到Redis。 6. 异常处理和日志记录。 在代码示例中需要展示这些步骤,同时引用用户提供的configparser的引用,比如处理路径问题使用os.path.join(BASE_DIR, 'config.ini'),如引用[2]中的方法。 可能的问题: - 用户提到“同时根据配置文件中的黑名单关键字决定是否发送告警”,所以过滤逻辑是当消息包含黑名单中的任何关键字时,不发送。因此,在代码中,如果消息内容包含任意黑名单关键字,跳过;否则发送。 - 是否需要使用正则表达式进行匹配,而不仅仅是子字符串匹配?比如,是否要匹配整个单词?问题中没有说明,所以保持简单,使用子字符串检查。 最后,生成相关问题,例如关于性能优化,配置管理,异常处理等。</think>### 从Kafka消费消息并通过Redis发送告警的实现步骤 #### 1. 配置文件设置 创建 `config.ini` 文件,包含以下内容: ```ini [Kafka] bootstrap_servers = localhost:9092 topic = alerts group_id = alert_consumer [Redis] host = localhost port = 6379 db = 0 alert_channel = alerts_channel [Filter] blacklist = error,failure,outage ``` #### 2. 读取配置文件 使用 `configparser` 读取配置并处理路径问题[^2]: ```python import configparser import os from kafka import KafkaConsumer import redis BASE_DIR = os.path.dirname(os.path.abspath(__file__)) config = configparser.ConfigParser() config.read(os.path.join(BASE_DIR, 'config.ini')) # 读取Kafka配置 bootstrap_servers = config.get('Kafka', 'bootstrap_servers') topic = config.get('Kafka', 'topic') group_id = config.get('Kafka', 'group_id', fallback='default_group') # 读取Redis配置 redis_host = config.get('Redis', 'host') redis_port = config.getint('Redis', 'port') redis_db = config.getint('Redis', 'db') alert_channel = config.get('Redis', 'alert_channel', fallback='alerts') # 读取黑名单 blacklist = [ kw.strip() for kw in config.get('Filter', 'blacklist', fallback='').split(',') if kw.strip() ] ``` #### 3. 初始化Kafka消费者和Redis连接 ```python # 初始化Kafka消费者 consumer = KafkaConsumer( topic, bootstrap_servers=bootstrap_servers.split(','), group_id=group_id, auto_offset_reset='earliest' ) # 初始化Redis连接 redis_conn = redis.Redis( host=redis_host, port=redis_port, db=redis_db ) ``` #### 4. 消费消息并过滤 ```python for message in consumer: msg_value = message.value.decode('utf-8') # 检查黑名单 if any(keyword in msg_value for keyword in blacklist): print(f"过滤消息(含黑名单关键字): {msg_value}") continue # 发送到Redis频道 redis_conn.publish(alert_channel, msg_value) print(f"已发送告警: {msg_value}") ``` #### 5. 异常处理 - **配置缺失**:捕获 `NoSectionError` 和 `NoOptionError` - **连接失败**:添加 `try...except` 块处理网络异常 ```python try: bootstrap_servers = config.get('Kafka', 'bootstrap_servers') except configparser.NoSectionError: print("配置文件中缺少Kafka部分") exit(1) ``` --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值