1.获取所有的device和短信记录(仅限个人使用smslab的接口。。别把apikey给泄漏啦!!!不然所有信息泄露不管我的事哦~~)
①.在/core/app/Http/Controllers/Api/Admin/SmsController.php 增加函数

/**自定义增加获取device列表**/    
public function getDevice(Request $request)
{
    $query        = Device::filter(['status'])->latest();
    $allDevice    = $query->get();
    echo json_encode($allDevice,true);
}
 /**自定义增加获取sms列表
 * 请求参数:mobile_number;device_id;status;date;sms_type;
 * mobile_number:接收手机号
 * device_id:设备id
 * status:0=未发送,1=已发送,2=等待发送,3=计划发送,4=处理中,9=失败
 * date :日期
 * sms_type 1:发送 2:接收
**/    
public function getSMS(Request $request)
{
    $messages  = Sms::filter(['mobile_number', 'sms_type', 'status', 'device_id'])->limit(10)->dateFilter()->with('device','failReason')->orderBy('id', 'desc')->get();
    echo json_encode($messages,true);
}

②.在/core/routes/api.php 增加两条路由规则:

    ///=============API implementation route ================
    Route::controller('SmsController')->prefix('sms')->middleware('apikey')->group(function () {
        Route::post('/send', 'send')->name('sms.send');
        Route::get('/getDevice', 'getDevice')->name('sms.getDevice');//获取设备
        Route::get('/getSMS', 'getSMS')->name('sms.getSMS');//获取短信
        Route::get('/send/get', 'sendViaGet')->name('sms.send.get');
    });

2.smslab汉化
在/core/config/app.php 修改参数'locale' => 'zh_CN',
在/core/resources/lang/ 下新建一个文件名zh_CN.json,复制下面谷歌翻译的汉化~~~并非全部汉化哦,只是ui汉化,一些提示需要另外在去汉化,懒得弄了

{
"Dashboard":"面板",  
"Welcome to":"欢迎使用",  
"to":"至",  
"Admin Login":"管理员登录",  
"Username":"用户名",  
"Password":"密码",  
"Remember Me":"记住我",  
"Forgot Password?":"忘记密码?",  
"LOGIN":"登录",  
"Manage Contact":"管理联系人",  
"Manage Group":"管理群组",  
"Manage Contacts":"管理联系人",  
"Add Contact":"添加联系人",
"Mobile Number":"手机号码",
"+1 (452) 338-9111":"13312341234",
"Import Contact": "导入联系人",  
"The file you wish to upload has to be formatted as we provided template files": "您希望上传的文件必须按照我们提供的模板文件格式进行格式化",  
" Any changes to these files will be considered as an invalid file format": "对这些文件的任何更改都将被视为无效的文件格式",  
"Download links are provided below.": "下载链接如下所示。",  
"Select File": "选择文件",  
"Supported files:": "支持的文件:",  
"Download the all template file from here": "从这里下载所有模板文件",  
"Upload": "上传",  
"Export Filter": "导出筛选",  
"Export Item": "导出条数",  
"Custom": "自定义",  
"Template Name": "模板名称",  
"Template Sms": "短信模板",  
"Add Group": "添加群组",  
"Device": "设备",  
"Receeived": "已接收",
"Regenerate API Key": "重新生成API密钥",
"Register Pusher": "注册Pusher",
"File Upload Information": "文件上传信息",  
"The file you wish to upload has to be formatted as we provided template files. Any changes to these files will be considered as an invalid file format. Download links are provided below": "您希望上传的文件必须按照我们提供的模板文件格式进行格式化。对这些文件的任何更改都将被视为无效的文件格式。下载链接如下所示。",  
"Template": "模板",  
"Manage Batch": "管理批次",  
"If the logo and favicon are not changed after you update from this page, please clear the cache from your browser. As we keep the filename the same after the update, it may show the old image for the cache. usually, it works after clear the cache but if you still see the old logo or favicon, it may be caused by server level or network level caching. Please clear them too": "如果从此页面更新后徽标和网站图标没有更改,请清除浏览器的缓存。因为我们在更新后保持文件名不变,所以缓存中可能会显示旧图像。通常,清除缓存后就可以正常工作,但如果您仍然看到旧的徽标或网站图标,可能是由服务器级别或网络级别缓存引起的。请也清除它们。",  
"Extension": "扩展名",  
"Disabled": "已禁用",  
"Search...": "搜索...",  
"Sent to": "发送到",  
"Test Mail Setup": "测试邮件设置",  
"ViserAdmin Version": "ViserAdmin 版本",  
"Laravel Version": "Laravel 版本",  
"ADD YOUR DEVICE": "添加您的设备",  
"Install our SMSLab android app on your mobile device.": "在您的移动设备上安装我们的SMSLab Android应用。",  
"Scan the below QR code to connect your device.": "扫描下面的二维码以连接您的设备。",  
"No results found": "未找到结果",  
"Start Date-End Date": "开始日期-结束日期",  
"Delivered": "已发送",  
"Pending": "待发送",  
"Scheduled": "已计划",  
"Processing": "处理中",  
"Faild": "失败",  
"Send": "发送",  
"Received": "已接收",  
"INTRODUCTION": "介绍",  
"API KEY": "API 密钥",  
"API integration is pretty simple and easy. using our API you can send SMS to any mobile number. You can send scheduled messages using our API. Our API is easy to implement in any other web application. Our API is well-formatted, accepts GET & POST request, and returns JSON responses. All URLs are case-sensitive": "API集成非常简单和容易。使用我们的API,您可以向任何手机号码发送短信。您可以使用我们的API发送计划消息。我们的API易于在任何其他Web应用程序中实现。我们的API格式良好,接受GET和POST请求,并返回JSON响应。所有URL都是区分大小写的",  
"Get your API key from the below. The API key is used to authenticate the request and determines whether the request is valid or not. If you want to regenerate the API key from the below sync icon": "从下面获取您的API密钥。API密钥用于对请求进行身份验证,并确定请求是否有效。如果您想从下面的同步图标重新生成API密钥。",  
"You will need to make request with these following API end points": "您将需要使用以下API端点进行请求。",  
"Using this endpoint you can send SMS to multiple numbers, schedule SMS and change the default device SIM slot. Request to the end point with the following parameters below. The parameters must be send with request body & request header must be needed to valid API key": "使用这个端点,您可以向多个号码发送短信,计划短信并更改默认设备的SIM卡槽。使用以下参数向端点发出请求。参数必须与请求正文一起发送,并且必须需要有效的API密钥来请求标头。",  
"Param Name": "参数名称",  
"Param Type": "参数类型",  
"Validate": "验证",  
"SEND SMS(GET)": "发送短信(GET)",  
"Using this endpoint you can send SMS to single numbers. Some restricted here, using this endpoint you can't send multiple, or schedule SMS and also you can't change the default device SIM slot. Request to the end point with the following parameters below. The parameters must be pass as query-string via endpoint or URLs": "使用这个端点,您可以向单个号码发送短信。这里有一些限制,使用这个端点,您不能发送多条短信,也不能计划短信,同时您也不能更改默认设备的SIM卡槽。使用以下参数向端点发出请求。参数必须作为查询字符串通过端点或URL传递。",  
"ERROR CODE": "错误代码",  
"Maximum 160 Charter": "最多160个字符",  
"Must valid API KEY": "必须有效的API密钥",  
"If you also send schedule SMS. you can control when sending SMS. The date must be a future date, by default is the current DateTime.": "如果您还发送计划短信。您可以控制发送短信的时间。日期必须是将来的日期,默认情况下是当前日期时间。",  
"The Date format must be": "日期格式必须是",  
"If your device has multiple SIM, then you can choose which SIM from sending SMS to. By Default send from SIM 1.": "如果您的设备有多个SIM卡,那么您可以选择从哪个SIM卡发送短信。默认情况下从SIM卡1发送。",  
"Device ID, which device to send from SMS.": "设备ID,从哪个设备发送短信。",  
"You can send sms to multiple numbers using this format": "您可以使用以下格式向多个号码发送短信",  
"How many items interested to export": "希望导出多少条内容?",  
"Id": "ID",  
"Order By": "排序方式",  
"ASC": "升序",  
"DESC": "降序",  
"Created at": "创建时间",  
"Updated at": "更新时间",
"Manage Template":"管理模板",  
"Manage Device":"管理设备",  
"Manage SMS":"管理短信",  
"Send SMS":"发送短信",  
"Send Sms":"发送短信",  
"SMS History":"短信历史",  
"Developer Tools":"开发者工具",  
"GENERAL SETTING":"通用设置",  
"General Setting":"通用设置",  
"Logo & Favicon":"Logo和Favicon",  
"Extensions":"扩展",  
"Notification Setting":"通知设置",  
"Email Setting":"邮件设置",  
"Global Template":"全局模板",  
"Notification Templates":"通知模板",  
"EXTRA":"额外",  
"System":"系统",  
"Application":"应用",  
"Server":"服务器",  
"Cache":"缓存",  
"Report & Request":"报告与请求",  
"Total SMS":"短信总数",  
"Total Delived SMS":"已发送短信总数",  
"Total Pending SMS":"待发送短信总数",  
"Total Schedule SMS":"定时短信总数",  
"Total Processing SMS":"处理中短信总数",  
"Total Failed SMS":"失败短信总数",  
"Total Sent SMS":"总发送短信数",  
"Total Received SMS":"总接收短信数",  
"View All":"查看全部",  
"Total Contact":"联系人总数",  
"Active Contact":"活跃联系人",  
"Inactive Contact":"非活跃联系人",  
"Total Template":"模板总数",  
"Total Device":"设备总数",  
"Total Conncted Device":"已连接设备总数",  
"Disconncted Device":"断开设备总数",  
"Active Templates":"活跃模板",  
"Total Group":"群组总数",  
"Total Active Group":"活跃群组总数",  
"Total Inactive Group":"非活跃群组总数",  
"Inactive Template":"非活跃模板",  
"Last Cron Run:":"最后一次运行:",  
"New":"新建",  
"Import":"导入",  
"Export":"导出",  
"Filter":"过滤器",  
"Mobile":"手机号码",  
"Search with mobile number":"按手机号码搜索",  
"Status":"状态",  
"All":"全部",  
"Active":"活跃中",  
"Inactive":"非活跃",  
"Action":"操作",  
"S.N.":"序号",  
"Data not found":"数据未找到",  
"Name":"名称",  
"New Group":"新建群组",  
"New Template":"新建模板",  
"Model":"型号",  
"Device ID":"设备ID",  
"Android Verison":"Android版本",  
"App Version":"应用版本",  
"Connected":"已连接",  
"Add Device":"添加设备",  
"Search here...":"在此搜索...",  
"Select SIM":"选择SIM卡",  
"Please Select One":"请选择一个",  
"Please select one":"请选择一个",  
"Please Select Device":"请选择设备",  
"Schedule":"定时发送",  
"Send Now":"立即发送",  
"Add Schedule":"添加定时发送任务",  
"Date":"日期",  
"Mobile Numbers": "手机号码",  
"+1 (143) 896-7781,+1 (191) 524-4782": "+1 (143) 896-7781,+1 (191) 524-4782",  
"Mobile Numbers From Contact List": "从联系人列表中选择手机号码",  
"Mobile Numbers From Group": "从分组中选择手机号码",  
"Upload File": "上传文件",  
"Supported files": "支持的文件",  
"Download all of the template files from here": "从这里下载所有模板文件",  
"Write SMS": "编写短信",  
"Select One": "选择一个",  
"Sms": "短信",  
"Submit": "提交",  
"All SMS": "所有短信",  
"All Device": "所有设备",  
"Sms Type": "短信类型",  
"Batch Number": "批次号",  
"Total Pending": "总待处理",  
"Total Delivered": "总已发送",  
"Total Processing": "总处理中",  
"Total Shcedule": "总计划中",  
"Total Faild": "总失败",  
"API Documentation": "API文档",  
"INTRODUCEDUCTION": "介绍",  
"Get Started": "开始使用",  
"Introduction": "简介",  
"API key": "API密钥",  
"Send Message(POST)": "发送消息(POST)",  
"Send Message(GET)": "发送消息(GET)",  
"Error Code": "错误代码",  
"Site Title": "网站标题",  
"Timezone": "时区",  
"Batch Prefix": "批次前缀",  
"Email Notification": "电子邮件通知",  
"SMS Notification": "短信通知",  
"Enable": "启用",  
"Disable": "禁用",  
"Pusher Setting": "Pusher设置",  
"Pusher App ID": "Pusher应用ID",  
"Pusher App Key": "Pusher应用密钥",  
"Pusher App Secret": "Pusher应用密钥(Secret)",  
"Pusher App Cluster": "Pusher应用集群",  
"Select Logo": "选择Logo",  
"Select Favicon": "选择网站图标(Favicon)",  
"Configure": "配置",  
"Help": "帮助",  
"Update Extension": "更新扩展",  
"Random String": "随机字符串",  
"Site Key": "网站密钥",  
"Secret Key": "密钥(Secret)",  
"Email Send Method": "电子邮件发送方式",  
"Send Test Mail": "发送测试邮件",  
"Email Notification Settings": "电子邮件通知设置",  
"SMTP Configuration": "SMTP配置",  
"Host": "主机",  
"Port": "端口",  
"Encryption": "加密方式",  
"Global Template for Notification": "全局通知模板",  
"Short Code": "短代码",  
"Description": "描述",  
"Full Name of User": "用户全名",  
"Username of User": "用户名",  
"Message": "消息内容",  
"Global Short Codes": "全局短代码",  
"Email Sent From": "电子邮件发送者",  
"Edit": "编辑",  
"Subject": "主题",  
"Default Template": "默认模板",  
"Password - Reset - Code": "密码 - 重置 - 代码",  
"Password - Reset - Confirmation": "密码 - 重置 - 确认",  
"Application Information": "应用信息",  
"Version": "版本",  
"Server Information": "服务器信息",
"Server Software": "服务器软件",  
"Server IP Address": "服务器IP地址",  
"Server Protocol": "服务器协议",  
"HTTP Host": "HTTP主机",  
"Server Port": "服务器端口",  
"Clear System Cache": "清除系统缓存",  
"Compiled views will be cleared": "已编译的视图将被清除",  
"Application cache will be cleared": "应用缓存将被清除",  
"Route cache will be cleared": "路由缓存将被清除",  
"Configuration cache will be cleared": "配置缓存将被清除",  
"Compiled services and packages files will be removed": "已编译的服务和包文件将被移除",  
"Caches will be cleared": "缓存将被清除",  
"Click to clear": "点击清除",  
"Your Listed Report & Request": "您列出的报告与请求",  
"Report a bug": "报告错误",  
"Request for Support": "请求支持",  
"Type": "类型",  
"Feature Request": "功能请求",  
"Logout": "退出",  
"Profile": "个人资料",  
"Profile Information": "个人信息",  
"Email": "电子邮件",  
"Password Setting": "密码设置",  
"Upload Image": "上传图片",  
"Image will be resized into 400x400px": "图片将被缩放至400x400像素",  
"Notification": "通知",  
"No unread notification found": "暂未有未读通知",  
"View all notification": "查看所有通知",  
"Notifications": "通知",  
"Change Password": "更改密码",  
"New Password": "新密码",  
"Confirm Password": "确认密码",  
"Profile Setting": "个人资料设置",
"Mark All as Read": "全部设为已读"}
最后修改:2023 年 12 月 15 日
如果觉得我的文章对你有用,请随意赞赏