Browse Source

Merge branch 'master' of github.com:star7th/showdoc

star7th 7 years ago
parent
commit
2aaefb6ee3

+ 1 - 1
composer.json

@@ -5,7 +5,7 @@
     "description": "ShowDoc is a tool greatly applicable for an IT team to share documents online",
     "keywords": ["showdoc","documents","Api"],
     "homepage": "https://github.com/star7th/showdoc",
-    "version":"v2.3.0",
+    "version":"v2.3.1",
     "license": "Apache-2.0",
     "authors": [
         {

+ 2 - 2
server/Application/Api/Controller/ItemController.class.php

@@ -449,7 +449,7 @@ class ItemController extends BaseController {
                 return;
             }
         }
-
+        session('v_code',null) ;
         $item = D("Item")->where("item_id = '$item_id' ")->find();
         if ($item['password'] == $password) {
             session("visit_item_".$item_id , 1 );
@@ -549,4 +549,4 @@ class ItemController extends BaseController {
     }
 
 
-}
+}

+ 2 - 2
server/Application/Api/Controller/UserController.class.php

@@ -11,6 +11,7 @@ class UserController extends BaseController {
         $confirm_password = I("confirm_password");
         $v_code = I("v_code");
         if (C('CloseVerify') || $v_code && $v_code == session('v_code') ) {
+        session('v_code',null) ;
         if ( $password != '' && $password == $confirm_password) {
 
             if ( ! D("User")->isExist($username) ) {
@@ -22,7 +23,6 @@ class UserController extends BaseController {
                     session("login_user" , $ret );
                     $token = D("UserToken")->createToken($ret['uid']);
                     cookie('cookie_token',$token,60*60*24*90);//此处由服务端控制token是否过期,所以cookies过期时间设置多久都无所谓
-                    session('v_code',null) ;
                   $this->sendResult(array()); 
 
                 }else{
@@ -53,7 +53,7 @@ class UserController extends BaseController {
                 return;
             }
         }
-
+        session('v_code',null) ;
         $ret = D("User")->checkLogin($username,$password);
         if ($ret) {
           unset($ret['password']);

+ 1 - 0
web_src/src/components/user/Register.vue

@@ -78,6 +78,7 @@ export default {
                 //that.$message.success("注册成功");
                 that.$router.push({path:'/item/index'});
               }else{
+                that.change_v_code_img() ;
                 that.$alert(response.data.error_message);
               }