コード例 #1
0
ファイル: Response.php プロジェクト: 3032441712/person
 /**
  * 表单提交返回相应的信息
  * 
  * @param array $array  数据数组
  * @param int   $status 相应的状态(0=>成功, 1=>失败)
  * 
  * @return void
  */
 public static function json($array, $status = 0)
 {
     $array['code'] = $status;
     $array['token'] = Token::create();
     echo json_encode($array);
     exit(0);
 }
コード例 #2
0
ファイル: index.php プロジェクト: 3032441712/person
                <span></span>
            </div>
            <div class="line">
                <label for="password">登录密码</label>
                <input id="password" name="user[pass]" type="password" value="" />
            </div>
            <!--
            <div class="line">
                <label for="">验证码</label>
                <input type="text" />
                <img alt="验证码" src="">
            </div>
            -->
            <div class="line">
                <input type="hidden" id="token" name="token" value="<?php 
    echo Token::Create();
    ?>
" />
                <input id="login_btn" onclick="login_submit();" style="width: 100px; height: 25px; line-height: 25px; cursor: pointer;" type="button" value="登录系统" />
            </div>
            <?php 
} else {
    ?>
            <div class="line" style="height: 30px; line-height: 30px;">
                <strong>当前用户:<?php 
    echo $_SESSION['user_name'];
    ?>
</strong>
            </div>
            <div class="line">
                <input onclick="login_system();$(this).attr('disabled', true);" style="width: 100px; height: 25px; line-height: 25px; cursor: pointer;" type="button" value="登录系统" />