/**
  * Creates a new Ip model.
  * 创建一个新的IP绑定,并且将绑定数据存入数据库
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Ip();
     if ($post = Yii::$app->request->post()) {
         $model->load(Yii::$app->request->post());
         $telnet = new telnet();
         $loginMsg = $telnet->signin();
         $telnet->bind($model->ip, $model->mac);
         $telnet->close();
         $model->save();
         if ($model->type == 3) {
             return $this->redirect(['charge', 'ip' => $model->ip]);
         } else {
             return $this->redirect(['index']);
         }
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }