model = new \app\admin\model\VbotRobot; } /*验证机器人配置*/ public function msg_test() { $VbotLib = new \addons\vbot\library\VbotLib(); $webhook = $this->request->only('webhook'); if (!$webhook['webhook']) { $this->error('请输入Hook地址!'); } $data = array( 'msgtype' => 'text', 'text' => [ 'content' => '这是一条测试消息!', 'mentioned_mobile_list' => ["@all"] ] ); $res = $VbotLib->msgSend($webhook['webhook'], $data); if ($res['errcode'] == 0) { $this->success('消息发送成功!'); } else { $this->error($res['errmsg'] . '(' . $res['errcode'] . ')'); } } }