Example #1
0
 public function setMailOfForgot($mail)
 {
     $verify = XiiToken::get([self::$_forgotMailField => $mail]);
     $verify_url = Yii::$app->request->getHostInfo() . Yii::$app->request->getUrl() . '/?' . self::$_forgotMailField . '=' . $mail . '&' . self::$_forgotVerifyField . '=' . $verify;
     $verify_url = str_replace('/forgotpwd', '/verifyforgot', $verify_url);
     $mail = ['to' => $mail, 'from' => '*****@*****.**', 'subject' => '忘记密码邮件,感谢使用基于XiiBackend开发的网站', 'body' => date('Y-m-d H:i:s', time()) . $verify_url];
     return $mail;
 }
Example #2
0
 private static function doEncrypt()
 {
     if (Yii::$app->response->format == Response::FORMAT_JSON) {
         if (isset(self::$_outputData[XIIS_FEEDBACK_DATA]) && !empty(self::$_outputData[XIIS_FEEDBACK_DATA])) {
             if (!is_array(self::$_outputData[XIIS_FEEDBACK_DATA])) {
                 self::$_outputData[XIIS_FEEDBACK_DATA] = [self::$_outputData[XIIS_FEEDBACK_DATA]];
             }
             self::$_outputData[XIIS_FEEDBACK_DATA][XiiToken::getIndex()] = XiiToken::get(self::$_outputData[XIIS_FEEDBACK_DATA]);
         }
     }
 }