Explorar o código

默认隐藏验证码

star7th %!s(int64=8) %!d(string=hai) anos
pai
achega
4ddfa4bb82

+ 36 - 3
Application/Home/View/Item/pwd.html

@@ -2,7 +2,7 @@
 <link rel="stylesheet" href="__PUBLIC__/css/login.css" />
     <div class="container">
 
-      <form class="form-signin" method="post">
+            <form class="form-signin myform" method="post" action="server/index.php?s=/api/item/pwd">
         <h3 class="form-signin-heading">{$Think.Lang.input_visit_password}</h3>
         <input type="hidden" id="item_id" name="item_id" value="{$item_id}">
         <input type="password" class="input-block-level" name="password" placeholder="{$Think.Lang.password}">
@@ -21,14 +21,47 @@
     </div> <!-- /container -->
 
 
- <include file="Common/footer" />
-
+<include file="Common/footer" />
+<script src="__PUBLIC__/js/jquery.form.min.js"></script>
  <script type="text/javascript">
  $(function(){
+    $("#input_v_code").hide();
+    $("#v_code_img").hide();
     $("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');
+
     $("#v_code_img").click(function(){
       var v_code_img = $("#v_code_img").attr("src");
       $("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
     }); 
+
+    //上传表单参数
+    var ajax_option = {
+      dataType:"json",
+      beforeSubmit:function(){
+
+      },
+      success:function(res){
+        if (res.error_code === 0) {
+          if (res.refer_url) {
+            var url = res.refer_url;
+          }else{
+            var url = '?s=/'+$("#item_id").val();
+          }
+          window.location.href = url;
+        }else{
+          $.alert(res.error_message);
+
+          if (res.error_code === 10206 || res.error_code === 10308 ) {
+            $("#v_code_img").click();
+            $("#v_code_img").show();
+            $("#input_v_code").show();
+          };
+          
+        }
+      }
+    };
+
+    $('.myform').ajaxForm(ajax_option); 
  });
 </script>
+

+ 34 - 5
Application/Home/View/User/login.html

@@ -3,12 +3,12 @@
 
     <div class="container">
 
-      <form class="form-signin" method="post">
+      <form class="form-signin myform" method="post" action="server/index.php?s=/api/user/login">
         <h3 class="form-signin-heading">{$Think.Lang.login}</h3>
         <input type="text" class="input-block-level"  name="username" placeholder="{$Think.Lang.username}">
         <input type="password" class="input-block-level" name="password" placeholder="{$Think.Lang.password}">
         <if  condition="$CloseVerify != 1">
-        <input type="text" class="input-block-level"  autocomplete="off" name="v_code" placeholder="{$Think.Lang.verification_code}">
+        <input type="text" class="input-block-level" id="input_v_code" autocomplete="off" name="v_code" placeholder="{$Think.Lang.verification_code}">
         <div class="control-group">
           <div class="controls">
             <img src="#" id="v_code_img">
@@ -22,14 +22,43 @@
     </div> <!-- /container -->
 
 
- <include file="Common/footer" />
-
+<include file="Common/footer" />
+<script src="__PUBLIC__/js/jquery.form.min.js"></script>
  <script type="text/javascript">
  $(function(){
+    $("#input_v_code").hide();
+    $("#v_code_img").hide();
     $("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');
+
     $("#v_code_img").click(function(){
       var v_code_img = $("#v_code_img").attr("src");
       $("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
     }); 
+
+    //上传表单参数
+    var ajax_option = {
+      dataType:"json",
+      beforeSubmit:function(){
+
+      },
+      success:function(res){
+        if (res.error_code === 0) {
+          window.location.href = "?s=/home/item/index";
+        }else{
+          $.alert(res.error_message);
+
+          if (res.error_code === 10206 || res.error_code === 10210 ) {
+            $("#v_code_img").click();
+            $("#v_code_img").show();
+            $("#input_v_code").show();
+          };
+          
+        }
+      }
+    };
+
+    $('.myform').ajaxForm(ajax_option); 
+
+
  });
-</script>
+ </script>

+ 22 - 3
Application/Home/View/User/register.html

@@ -3,7 +3,7 @@
 
     <div class="container">
 
-      <form class="form-signin" method="post">
+      <form class="form-signin myform" method="post" action="server/index.php?s=api/user/register">
         <h3 class="form-signin-heading">{$Think.Lang.register_new_account}</h3>
         <input type="text" class="input-block-level" name="username" placeholder="{$Think.Lang.username_description}">
         <input type="password" class="input-block-level" name="password"  placeholder="{$Think.Lang.password}">
@@ -23,8 +23,8 @@
     </div> <!-- /container -->
 
 
- <include file="Common/footer" />
-
+<include file="Common/footer" />
+<script src="__PUBLIC__/js/jquery.form.min.js"></script>
  <script type="text/javascript">
  $(function(){
     $("#v_code_img").attr("src" , DocConfig.pubile+'/verifyCode.php');
@@ -32,6 +32,25 @@
       var v_code_img = $("#v_code_img").attr("src");
       $("#v_code_img").attr('src' ,v_code_img+'?'+Date.parse(new Date()) );
     }); 
+
+    //上传表单参数
+    var ajax_option = {
+      dataType:"json",
+      beforeSubmit:function(){
+
+      },
+      success:function(res){
+        if (res.error_code === 0) {
+          window.location.href = "?s=/home/item/index";
+        }else{
+          $.alert(res.error_message);
+          $("#v_code_img").click();
+        }
+      }
+    };
+
+    $('.myform').ajaxForm(ajax_option); 
+
  });
 
 </script>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 10 - 0
Public/js/jquery.form.min.js


+ 4 - 2
server/Application/Api/Conf/config.php

@@ -23,6 +23,7 @@ return array(
 		10207 => ' There is no such name',		//该昵称不存在
 		10208 => ' 密码错误',		
 		10209 => ' 该用户不存在或者尚未注册',		
+		10210 => ' Username or password is wrong',	//用户名或者密码错误,并且输入错误次数过多	
 
 		//项目类错误
 		10301 => '没有项目访问权限',		
@@ -31,8 +32,9 @@ return array(
 		10304 => '个性域名已经存在',		
 		10305 => '个性域名只能是字母或数字的组合',		
 		10306 => 'api_key 或 api_token 不匹配',		
-
-		
+		10307 => ' password is wrong',	//输入项目密码错误	
+		10308 => ' password is wrong',	//输入项目密码错误,并且输入错误次数过多	
+				
 		),
 	'API_LOG' => false ,  //是否开启API请求日志记录。如果开启,则记录每一个API请求的参数和返回结果,会生成很多日志
 );

+ 33 - 0
server/Application/Api/Controller/ItemController.class.php

@@ -320,4 +320,37 @@ class ItemController extends BaseController {
         }
     }
     
+    //验证访问密码
+    public function pwd(){
+        $item_id = I("item_id/d");
+        $password = I("password");
+        $v_code = I("v_code");
+        $refer_url = I('refer_url');
+
+        //检查用户输错密码的次数。如果超过一定次数,则需要验证 验证码
+        $key= 'item_pwd_fail_times_'.$item_id;
+        if(!D("VerifyCode")->_check_times($key,10)){
+            if (!$v_code || $v_code != session('v_code')) {
+                $this->sendError(10206,L('verification_code_are_incorrect'));
+                return;
+            }
+        }
+
+        $item = D("Item")->where("item_id = '$item_id' ")->find();
+        if ($item['password'] == $password) {
+            session("visit_item_".$item_id , 1 );
+            $this->sendResult(array("refer_url"=>base64_decode($refer_url))); 
+        }else{
+            D("VerifyCode")->_ins_times($key);//输错密码则设置输错次数
+            
+            if(D("VerifyCode")->_check_times($key,10)){
+                $error_code = 10307 ;
+            }else{
+                $error_code = 10308 ;
+            }
+            $this->sendError($error_code,L('access_password_are_incorrect'));
+        }
+
+    }
+
 }

+ 79 - 0
server/Application/Api/Controller/UserController.class.php

@@ -0,0 +1,79 @@
+<?php
+namespace Api\Controller;
+use Think\Controller;
+class UserController extends BaseController {
+
+
+    //注册
+    public function register(){
+        $username = I("username");
+        $password = I("password");
+        $confirm_password = I("confirm_password");
+        $v_code = I("v_code");
+        if (C('CloseVerify') || $v_code && $v_code == session('v_code') ) {
+        if ( $password != '' && $password == $confirm_password) {
+
+            if ( ! D("User")->isExist($username) ) {
+                $new_uid = D("User")->register($username,$password);
+                if ($new_uid) {
+                    //设置自动登录
+                    $ret = D("User")->where("uid = '$new_uid' ")->find() ;
+                    unset($ret['password']);
+                    session("login_user" , $ret );
+                    $token = D("UserToken")->createToken($ret['uid']);
+                    cookie('cookie_token',$token,60*60*24*90);//此处由服务端控制token是否过期,所以cookies过期时间设置多久都无所谓
+
+                  $this->sendResult(array()); 
+
+                }else{
+                    $this->sendError(10101,L('username_or_password_incorrect'));
+                }
+            }else{
+                $this->sendError(10101,L('username_exists'));
+            }
+
+        }else{
+            $this->sendError(10101,L('code_much_the_same'));
+        }
+        }else{
+            $this->sendError(10206,L('verification_code_are_incorrect'));
+        }
+    }
+    //登录
+    public function login(){
+        $username = I("username");
+        $password = I("password");
+        $v_code = I("v_code");
+
+        //检查用户输错密码的次数。如果超过一定次数,则需要验证 验证码
+        $key= 'login_fail_times_'.$username;
+        if(!D("VerifyCode")->_check_times($key)){
+            if (!$v_code || $v_code != session('v_code')) {
+                $this->sendError(10206,L('verification_code_are_incorrect'));
+                return;
+            }
+        }
+
+        $ret = D("User")->checkLogin($username,$password);
+        if ($ret) {
+          unset($ret['password']);
+          session("login_user" , $ret );
+          D("User")->setLastTime($ret['uid']);
+          $token = D("UserToken")->createToken($ret['uid']);
+          cookie('cookie_token',$token,60*60*24*90);//此处由服务端控制token是否过期,所以cookies过期时间设置多久都无所谓
+          $this->sendResult(array());               
+        }else{
+            D("VerifyCode")->_ins_times($key);//输错密码则设置输错次数
+            
+            if(D("VerifyCode")->_check_times($key)){
+                $error_code = 10204 ;
+            }else{
+                $error_code = 10210 ;
+            }
+            $this->sendError($error_code,L('username_or_password_incorrect'));
+            return;
+        }
+        
+    }
+
+}

+ 215 - 0
server/Application/Api/Lang/en-us.php

@@ -0,0 +1,215 @@
+<?php
+return array(
+
+    //Attorn
+    'attorn_item'=>'Attorn item',
+    'username'=>'Username',
+    'receiver_name'=>"Receiver's username",
+    'verify_identity'=>'Verify identity',
+    'your_password'=>'Your password',
+    'attorn'=>'Attorn',
+    'close'=>'close',
+
+    //Catalog
+    'new_or_edit_catalog' => 'New/Edit catalog',
+    'catalog_name' => 'Catalog name',
+    's_number' => 'Order',
+    's_number_explain' => 'Optional: order number',
+    'last_catalog' => 'Parent catalog',
+    'save' => 'Sava',
+    'delete_catalog' => 'Delete catalog',
+    'catalog_list' => 'Catalog list',
+    'click_to_edit' => 'Click to edit',
+
+
+    //index
+    'help' => 'Help',
+    'demo' => 'Demo',
+    'index_login_or_register' => 'Login / Register',
+    'my_item' => 'My items',
+    'section_title1' => 'ShowDoc',
+    'section_description1' => ' A tool greatly applicable for an IT team',
+    'section_title2' => 'API Document',
+    'section_description2' => 'ShowDoc can compile exquisite API documents <br>in a very fast and convenient way',
+    'section_title3' => 'Data Dictionary',
+    'section_description3' => 'A good Data Dictionary can easily exhibit database structure to other people<br>ShowDoc can compile exquisite Data Dictionary',
+    'section_title4' => 'Explanation Document',
+    'section_description4' => 'You can absolutely use ShowDoc to compile the explanation documents for some tools',
+    'section_title5' => 'Team Work',
+    'section_description5' => 'Your team will work with ShowDoc together very well ',
+    'section_title6' => 'Open Source',
+    'section_description6' => 'ShowDoc is a free, open source tool that <br>you can deploy it to your own server',
+    'section_title7' => 'Hosted online',
+    'section_description7' => 'Www.showdoc.cc provide security and stability of the document hosting service',
+    'section_title8' => 'Try it now',
+    'section_description8' => 'Over 6000+ IT team is using ShowDoc',
+
+
+    //Common message
+    'redirect_message' => 'If your browser does not automatically jump, please click on this link.',
+    'click_to_goback' => 'Click to goback',
+    'home' => 'Home',
+    
+
+    //item/add
+    'item_name' => "Item's name",
+    'item_description' => "Item's description",
+    'item_domain' => '(Optional)domain hack',
+    'item_domain_illegal' => 'Domain hack must be a combination of letters and numbers',
+    'domain_already_exists' => 'Domain already exists',
+    'visit_password_placeholder' => 'Access password(Optional: private project required)',
+    'submit' => 'Submit',
+    'goback' => 'Goback',
+    //item/delete
+    'delete_item' => 'Delete item',
+    'verify_your_identity' => 'Verify your identity',
+    'creator_password' => "creator's password",
+    'delete' => 'Delete',
+    'close' => 'Close',
+    //item/index
+    'personal_setting'=>'Personal setting',
+    'share_home'=>'Share home',
+    'web_home'=>'Website home',
+    'logout'=>'Logout',
+    'add_an_item'=>'Add an item',
+    'new_item'=>'New item',
+    'share_my_home'=>'Share my home',
+    'home_address'=>'Home address',
+    'home_address_description'=>'The others will be able to see all of your public items When he visits your home page.You can copy the address to your friends.',
+    //item/pwd
+    'input_visit_password'=>'Please enter the access password',
+    'password'=>'Passwod',
+    'verification_code'=>'Verification code',
+    'submit'=>'Submit',
+    'login_or_register'=>'Login/Register',
+    //item/show
+    'item'=>'Item',
+    'share'=>'Share',
+    'export'=>'Export',
+    'update_info'=>'Modify',
+    'manage_members'=>'Members',
+    'attorn'=>'Attorn',
+    'delete'=>'Delete',
+    'more_item'=>'More items',
+    'login_or_register'=>'Login/Register',
+    'about_showdoc'=>'About ShowDoc',
+    'my_item'=>'My items',
+    'new_page'=>'New page',
+    'new_catalog'=>'New catalog',
+    'share_address_to_your_friends'=>'Share address to your friends',
+    'share'=>'Share',
+    'copy_interface_to_new'=>'Copy page  to new ',
+    'copy'=>'Copy',
+    'edit_interface'=>'Edit page',
+    'edit'=>'Edit',
+    'delete_interface'=>'Delete page',
+    'comfirm_delete'=>'Are you sure that you want to delete it?',
+    'delete'=>'Delete',
+    'share'=>'Share',
+    'item_address'=>'Item address',
+    'copy_address_to_your_friends'=>'You can copy the address to your friend.',
+    'share_page'=>'Share page',
+    'page_address'=>'Page address',
+    'copy_address_to_your_friends'=>'You can copy the address to your friend.',
+    //item/showbyuid
+    'more'=>'More',
+    'my_item'=>'My items',
+    'login_or_register'=>'Login/Register',
+    'about_showdoc'=>'About ShowDoc',
+    'all_pubilc_item'=>"'s all public items",
+
+    //member
+    'new_member'=>'New member',
+    'username'=>'Username',
+    'save'=>'Save',
+    'member_list'=>'member list',
+    'click_to_delete'=>'Click to delete',
+    'close'=>'Close',
+    "member_group_id" => "Read-only(can read item ,but not edit or delete )",
+    //page
+    'input_page_title'=>'Please enter a page title',
+    'level_2_directory'=>'Second-level catalog',
+    'level_3_directory'=>'Third-level catalog',
+    's_number_explain'=>'Optional: order number',
+    'history_version'=>'History version',
+    'save'=>'Save',
+    'cancel'=>'Cancel',
+    'inser_apidoc_template'=>'Insert apidoc template',
+    'inser_database_doc_template'=>'Insert db-doc template',
+    'json_tools'=>'Json tools',
+    'json_to_table'=>'Json to table',
+    'beautify_json'=>'Beautify Json',
+    'beautify_json_description'=>'Make your json more beautiful ',
+    'http_test_api'=>'Api test online',
+    'json_to_table_description'=>'Please paste a section of JSON, the program will automatically parse and generate JSON parameters table. This feature is suitable for the rapid preparation of API documents returned to the parameter table',
+    'confirm'=>'Confirm',
+    'cancel'=>'Cancel',
+    'history_version'=>'History version',
+    'update_time'=>'Modification time',
+    'update_by_who'=>'Modified by who',
+    'operation'=>'Operation',
+    'recover_to_this_version'=>'Restore to this version',
+    'close'=>'Close',
+    'finish'=>'Finish',
+    'api_test_title'=>'Test for GET and POST',
+    'api_address_description'=>'Api address(e.g:ttp://www.abc.com/api/login)',
+    'api_address'=>'Api address',
+    'params_description'=>'Params(e.g:user_id=121&age=22&date=2016-06-02)',
+    'params'=>'Params',
+    'clear'=>'Clear',
+    'result'=>'Result',
+    'save_to_templ'=>'Save as template',
+    'more_templ'=>'More template',
+    'saved_templ_list'=>'Template list you saved',
+    'page_comments'=>'Page comments',
+    'add_page_comments'=>'Add comments before save',
+    'cur_page_content'=>'The latest version ',
+    'history_page_content'=>'History version',
+    'overview'=>'Overview',
+    //user
+    'login'=>'Login',
+    'username'=>'Username',
+    'password'=>'Passwod',
+    'verification_code'=>'Verification code',
+    'no_account'=>'Go to register →',
+    'register_new_account'=>'Register new user',
+    'username_description'=>'English name or Email',
+    'password'=>'Passwod',
+    'password_again'=>'Enter password again',
+    'verification_code'=>'Verification code',
+    'register'=>'Register',
+    'had_a_account'=>' Sign on right now→',
+    'update_personal_info'=>'Modify personal information',
+    'new_password_description'=>'The new password',
+    'old_password_description'=>'Original password',
+    'submit'=>'Submit',
+    'goback'=>'Goback',
+
+    //message 弹出信息有关的文案
+    'no_permissions'=>'No permissions',
+    'incorrect_password'=>'Incorrect password',
+    'user_does_not_exist'=>'User does not exist',
+    'operation_succeeded'=>'Operation succeeded',
+    'operation_failed'=>'Operation failed',
+    'access_password_are_incorrect'=>'Access password are incorrect',
+    'verification_code_are_incorrect'=>'Verification code are incorrect',
+    'no_permissions_to_delete_page'=>'No permissions!The page is created by {$author_username}',
+    'delete_succeeded'=>'Delete succeeded',
+    'delete_failed'=>'Delete failed',
+    'register_succeeded'=>'Register succeeded',
+    'username_or_password_incorrect'=>'Username or password are incorrect',
+    'username_exists'=>'Username exists',
+    'code_much_the_same'=>'Password much be the same',
+    'verification_code_are_incorrect'=>'Verification code are incorrect',
+    'auto_login_succeeded'=>'Automatic login success! Jumping...',
+    'login_succeeded'=>'Login succeeded',
+    'modify_succeeded'=>'Modify succeeded',
+    'modify_faild'=>'Modify failed',
+    'old_password_incorrect'=>'The original password is not correct',
+    'logout_succeeded'=>'Logout succeeded',
+
+    //error_message
+    "no_delete_empty_catalog"=>'In order to secure, do not allow direct delete an empty catalog. Please delete or move all the pages in the catalog',
+    
+    "default_title" =>'Default',
+);

+ 219 - 0
server/Application/Api/Lang/zh-cn.php

@@ -0,0 +1,219 @@
+<?php
+return array(
+
+    //Attorn
+    'attorn_item'=>'转让项目',
+    'username'=>'用户名',
+    'receiver_name'=>'项目接收者用户名',
+    'verify_identity'=>'验证身份',
+    'your_password'=>'你的登录密码',
+    'attorn'=>'转让',
+    'close'=>'关闭',
+
+    //Catalog
+    'new_or_edit_catalog' => '新建/编辑目录',
+    'catalog_name' => '目录名',
+    's_number' => '序号',
+    's_number_explain' => '可选:顺序数字',
+    'last_catalog' => '上级目录',
+    'save' => '保存',
+    'delete_catalog' => '删除目录',
+    'catalog_list' => '目录列表',
+    'click_to_edit' => '点击可编辑',
+
+
+    //index
+    'help' => '帮助',
+    'demo' => '示例',
+    'index_login_or_register' => '登录 / 注册',
+    'my_item' => '我的项目',
+    'section_title1' => 'ShowDoc',
+    'section_description1' => '一个非常适合IT团队的在线API文档、技术文档工具',
+    'section_title2' => 'API文档',
+    'section_description2' => ' APP、web前端与服务器常用API来进行交互<br>用ShowDoc可以非常方便快速地编写出美观的API文档',
+    'section_title3' => '数据字典',
+    'section_description3' => '好的数据字典可以很方便地向别人描述你的数据库结构<br>用ShowDoc可以编辑出美观的数字字典',
+    'section_title4' => '说明文档',
+    'section_description4' => '你完全可以使用 ShowDoc来编写一些工具的说明书<br>也可以编写一些技术规范说明文档以供团队查阅',
+    'section_title5' => '团队协作',
+    'section_description5' => '团队权限管理机制让团队良好地协同编写文档',
+    'section_title6' => '免费开源',
+    'section_description6' => 'ShowDoc提供免费开源的版本<br>你可以选择将ShowDoc部署到你的服务器',
+    'section_title7' => '在线托管',
+    'section_description7' => 'www.showdoc.cc 提供安全稳定的在线文档托管服务<br>你可以放心地选择托管你的文档数据在云端',
+    'section_title8' => '立即体验',
+    'section_description8' => '超过6000+互联网团队正在使用ShowDoc',
+
+
+    //Common message
+    'redirect_message' => '如果你的浏览器没有自动跳转,请点击此链接',
+    'click_to_goback' => '点击这里返回上一页',
+    'home' => '首页',
+    
+
+    //item/add
+    'item_name' => '项目名',
+    'item_description' => '项目描述',
+    'item_domain' => '(可选)个性域名',
+    'item_domain_illegal' => '个性域名只能是字母或数字的组合',
+    'domain_already_exists' => '个性域名已经存在',
+    'visit_password_placeholder' => '访问密码(可选,私密项目请设置密码)',
+    'submit' => '提交',
+    'goback' => '返回',
+    //item/delete
+    'delete_item' => '删除项目',
+    'verify_your_identity' => '验证你的身份',
+    'creator_password' => '创建人登录密码',
+    'delete' => '删除',
+    'close' => '关闭',
+    //item/index
+    'personal_setting'=>'个人设置',
+    'share_home'=>'分享主页',
+    'web_home'=>'网站首页',
+    'logout'=>'退出登录',
+    'add_an_item'=>'添加一个新项目',
+    'new_item'=>'新建项目',
+    'share_my_home'=>'分享我的主页',
+    'home_address'=>'主页地址',
+    'home_address_description'=>'别人访问您的主页时,将可以看到您的所有公开项目(但没有新建项目等权限)。你可以复制地址给你的好友',
+    //item/pwd
+    'input_visit_password'=>'请输入访问密码',
+    'password'=>'密码',
+    'verification_code'=>'验证码',
+    'submit'=>'提交',
+    'login_or_register'=>'登录/注册',
+    //item/show
+    'item'=>'项目',
+    'share'=>'分享',
+    'export'=>'导出',
+    'update_info'=>'修改信息',
+    'manage_members'=>'成员管理',
+    'attorn'=>'转让',
+    'delete'=>'删除',
+    'more_item'=>'更多项目',
+    'login_or_register'=>'登录/注册',
+    'about_showdoc'=>'关于ShowDoc',
+    'my_item'=>'我的项目',
+    'new_page'=>'新建页面',
+    'new_catalog'=>'新建目录',
+    'share_address_to_your_friends'=>'分享该接口地址给你的好友',
+    'share'=>'分享',
+    'copy_interface_to_new'=>'复制该页面到新页面',
+    'copy'=>'复制',
+    'edit_interface'=>'编辑页面',
+    'edit'=>'编辑',
+    'delete_interface'=>'删除页面',
+    'comfirm_delete'=>'确认删除吗?',
+    'delete'=>'删除',
+    'share'=>'分享',
+    'item_address'=>'项目地址',
+    'copy_address_to_your_friends'=>'你可以复制地址给你的好友',
+    'share_page'=>'分享页面',
+    'page_address'=>'页面地址',
+    'copy_address_to_your_friends'=>'你可以复制地址给你的好友',
+    //item/showbyuid
+    'more'=>'更多',
+    'my_item'=>'我的项目',
+    'login_or_register'=>'登录/注册',
+    'about_showdoc'=>'关于ShowDoc',
+    'all_pubilc_item'=>'的所有公开项目',
+
+    //member
+    'new_member'=>'新增成员',
+    'username'=>'用户名',
+    'save'=>'保存',
+    'member_list'=>'成员列表',
+    'click_to_delete'=>'点击可删除',
+    'close'=>'关闭',
+    "member_group_id" => "只读",
+    
+    //page
+    'input_page_title'=>'请输入页面标题',
+    'level_2_directory'=>'二级目录',
+    'level_3_directory'=>'三级目录',
+    's_number_explain'=>'可选:顺序数字',
+    'history_version'=>'历史版本',
+    'save'=>'保存',
+    'cancel'=>'取消',
+    'inser_apidoc_template'=>'插入API接口模板',
+    'inser_database_doc_template'=>'插入数据字典模板',
+    'json_tools'=>'JSON工具',
+    'json_to_table'=>'JSON转参数表格',
+    'beautify_json'=>'JSON格式化',
+    'beautify_json_description'=>'请粘贴一段json,程序将自动以美观的方式格式化显示',
+    'http_test_api'=>'在线测试API',
+    'json_to_table_description'=>'请粘贴一段json,程序将自动将json解析并生成参数表格。此功能适合用于快速编写API文档的返回参数表格',
+    'confirm'=>'确定',
+    'cancel'=>'取消',
+    'history_version'=>'历史版本',
+    'update_time'=>'修改时间',
+    'update_by_who'=>'修改人',
+    'operation'=>'操作',
+    'recover_to_this_version'=>'恢复到此版本',
+    'close'=>'关闭',
+    'finish'=>'完成',
+    'api_test_title'=>'GET和POST测试',
+    'api_address_description'=>'接口地址(如:http://www.abc.com/api/login)',
+    'api_address'=>'接口地址',
+    'params_description'=>'参数(如:user_id=121&age=22&date=2016-06-02)',
+    'params'=>'参数',
+    'clear'=>'清除',
+    'result'=>'返回结果',
+    'save_to_templ'=>'另存为模板',
+    'more_templ'=>'更多模板',
+    'saved_templ_list'=>'保存的模板列表',
+    'page_comments'=>'页面注释',
+    'add_page_comments'=>'保存前添加页面注释',
+    'cur_page_content'=>'当前最新版本',
+    'history_page_content'=>'历史版本',
+    'overview'=>'预览',
+
+    //user
+    'login'=>'登录',
+    'username'=>'用户名',
+    'password'=>'密码',
+    'verification_code'=>'验证码',
+    'no_account'=>'没有账号?马上去注册→',
+    'register_new_account'=>'注册新用户',
+    'username_description'=>'用户名(可填英文昵称或邮箱)',
+    'password'=>'密码',
+    'password_again'=>'再次输入密码',
+    'verification_code'=>'验证码',
+    'register'=>'注册',
+    'had_a_account'=>'已有账号?马上去登录→',
+    'update_personal_info'=>'修改个人信息',
+    'new_password_description'=>'新密码,若不修改请留空',
+    'old_password_description'=>'原密码,若不修改密码请留空',
+    'submit'=>'提交',
+    'goback'=>'返回',
+
+    //message 弹出信息有关的文案
+    'no_permissions'=>'你无权限',
+    'incorrect_password'=>'密码错误',
+    'user_does_not_exist'=>'不存在此用户',
+    'operation_succeeded'=>'操作成功!',
+    'operation_failed'=>'操作失败!',
+    'access_password_are_incorrect'=>'访问密码不正确',
+    'verification_code_are_incorrect'=>'验证码不正确',
+    'no_permissions_to_delete_page'=>'你无权限!此页面由{$author_username}创建',
+    'delete_succeeded'=>'删除成功!',
+    'delete_failed'=>'删除失败!',
+    'register_succeeded'=>'注册成功!',
+    'username_or_password_incorrect'=>'用户名或密码不正确',
+    'username_exists'=>'用户名已经存在啦!',
+    'code_much_the_same'=>'两次输入的密码不一致!',
+    'verification_code_are_incorrect'=>'验证码不正确',
+    'auto_login_succeeded'=>'自动登录成功!正在跳转...',
+    'login_succeeded'=>'登录成功!',
+    'modify_succeeded'=>'修改成功!',
+    'modify_faild'=>'修改失败!',
+    'old_password_incorrect'=>'原密码不正确',
+    'logout_succeeded'=>'退出成功!',
+
+    //error_message
+    "no_delete_empty_catalog"=>'为了安全,不允许直接删除非空目录。请先删除或转移该目录下的所有页面',
+    
+    "default_title" =>'默认页面',
+
+
+);

+ 33 - 0
server/application/Api/Model/VerifyCodeModel.class.php

@@ -0,0 +1,33 @@
+<?php
+namespace Api\Model;
+use Api\Model\BaseModel;
+/**
+ * 
+ * @author star7th      
+ */
+class VerifyCodeModel  {
+
+    //次数加1
+    public function _ins_times($key){
+        // 初始化缓存
+        S(array('type'=>'File','prefix'=>'think453434d','expire'=>60*60*24));
+        $cache_times = S($key);
+        $cache_times = intval($cache_times) ;
+        $ret = S($key, $cache_times + 1 , 24*60*60);
+        return $ret ;
+    }
+
+    public function _check_times($key , $max_times = 5 ){
+        // 初始化缓存
+        S(array('type'=>'File','prefix'=>'think453434d','expire'=>60*60*24));
+        $cache_times = S($key);
+        $cache_times = intval($cache_times) ;
+        if ($cache_times) {
+            if ($cache_times >= $max_times) {
+                return false;
+            }
+        }
+        return true ;
+    }
+
+}

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio