xxgkami

# 小小怪卡密验证系统 [![PHP Version](https://img.shields.io/badge/PHP-7.0+-blue.svg)](https://www.php.net) [![MySQL Version](https://img.shields.io/badge/MySQL-5.7+-orange.svg)](https://www.mysql.com) [![License](https://img.shields.io/github/license/xiaoxiaoguai-yyds/xxgkami)](https://github.com/xiaoxiaoguai-yyds/xxgkami/blob/main/LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/xiaoxiaoguai-yyds/xxgkami)](https://github.com/xiaoxiaoguai-yyds/xxgkami/stargazers) [![GitHub Issues](https://img.shields.io/github/issues/xiaoxiaoguai-yyds/xxgkami)](https://github.com/xiaoxiaoguai-yyds/xxgkami/issues) 一个功能强大、安全可靠的卡密验证系统,支持多种验证方式,提供完整的API接口。 适用于软件授权、会员验证等场景。

✨ 系统特点

🛡️ 安全可靠

🔌 API支持

⚡ 高效稳定

📊 数据统计

🚀 快速开始

环境要求

PHP >= 7.0
MySQL >= 5.7
Apache/Nginx

安装步骤

  1. 克隆项目
    git clone https://github.com/xiaoxiaoguai-yyds/xxgkami.git
    
  2. 上传到网站目录

  3. 访问安装页面
    http://your-domain/install/
    
  4. 按照安装向导完成配置

📚 使用说明

管理员后台

  1. 访问 http://your-domain/admin.php
  2. 使用安装时设置的管理员账号登录
  3. 进入管理面板

API调用示例

// POST请求示例
$url = 'http://your-domain/api/verify.php';
$data = [
    'card_key' => '您的卡密',
    'device_id' => '设备唯一标识'
];
$headers = ['X-API-KEY: 您的API密钥'];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

📋 功能列表

🔄 系统升级

重要提示:升级系统前请务必备份您的数据库,避免数据丢失。

数据库升级操作

如果您是从旧版本升级,需要执行以下数据库修改操作,以支持新功能:

  1. 添加卡密类型支持
    ALTER TABLE `cards` 
    ADD COLUMN `card_type` ENUM('time', 'count') DEFAULT 'time' COMMENT '卡密类型:time=时间卡,count=次数卡' AFTER `status`;
    
  2. 添加卡密次数限制
    ALTER TABLE `cards` 
    ADD COLUMN `total_count` INT DEFAULT 0 COMMENT '卡密总次数(次数卡使用)' AFTER `duration`,
    ADD COLUMN `remaining_count` INT DEFAULT 0 COMMENT '剩余使用次数' AFTER `total_count`;
    
  3. 添加验证方式字段
    ALTER TABLE `cards` 
    ADD COLUMN `verify_method` VARCHAR(20) DEFAULT NULL COMMENT '验证方式:web=网页,post=API,get=API' AFTER `device_id`;
    
  4. 更新已有卡密为时间卡
    UPDATE `cards` SET `card_type` = 'time' WHERE `card_type` IS NULL;
    
  5. 将永久卡密的duration设为0
    UPDATE `cards` SET `duration` = 0 WHERE `duration` IS NULL OR `duration` <= 0;
    

执行这些SQL语句后,您的数据库将支持新版本的所有功能,同时保留原有数据。

文件升级

  1. 备份您当前的config.php文件
  2. 上传新版本的所有文件到您的网站目录
  3. 恢复您的config.php文件
  4. 访问网站,系统会自动完成其余配置

🤝 参与贡献

  1. Fork 本仓库
  2. 创建新的分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 提交 Pull Request

📄 开源协议

本项目采用 MIT 协议开源,详见 LICENSE 文件。

⭐ Star 历史

Star History Chart

其他支持方式