Browse Source

Merge pull request #811 from visuddhinanda/laravel

🐛 重置密码错误
visuddhinanda 4 years ago
parent
commit
0fb0328f69
3 changed files with 13 additions and 3 deletions
  1. 5 2
      public/app/db/user.php
  2. 1 1
      public/app/dict/dict_lookup.php
  3. 7 0
      public/app/term/term.css

+ 5 - 2
public/app/db/user.php

@@ -5,7 +5,6 @@ require_once "../db/channel.php";
 require_once "../public/function.php";
 // Require Composer's autoloader.
 require_once '../../vendor/autoload.php';
-require_once '../config.php';
 
 // Using Medoo namespace.
 use Medoo\Medoo;
@@ -181,7 +180,11 @@ class User extends Table
 		$isExist = $this->medoo->has($this->table,["email"=>$email]);
 		if($isExist){
 			$resetToken = UUID::v4();
-			$ok = $this->_update(["reset_password_token"=>$resetToken],["reset_password_token"],["email"=>$email]);
+            $query = "UPDATE   ".$this->table." SET reset_password_token = ? WHERE email = ? ";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($resetToken,$email));
+            $ok = true;
+			//$ok = $this->_update(["reset_password_token"=>$resetToken],["reset_password_token"],["email"=>$email]);
 			if($ok){
 				#send email
 				$resetLink="https://".$_SERVER['SERVER_NAME']."/app/ucenter/reset.php?token=".$resetToken;

+ 1 - 1
public/app/dict/dict_lookup.php

@@ -46,7 +46,7 @@ $right_word_list = "";
         PDO_Connect("" . _FILE_DB_REF_);
         //直接查询
 
-        $query = "SELECT dict.dict_id,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN "._TABLE_DICT_REF_NAME_." as info ON dict.dict_id = info.id where word = ? limit 100";
+        $query = "SELECT dict.id, dict.dict_id,dict.mean,info.shortname from " . _TABLE_DICT_REF_ . " LEFT JOIN "._TABLE_DICT_REF_NAME_." as info ON dict.dict_id = info.id where word = ? limit 100";
 
         $Fetch = PDO_FetchAll($query, array($word));
         $iFetch = count($Fetch);

+ 7 - 0
public/app/term/term.css

@@ -1165,4 +1165,11 @@ guide.grammar_tag {
 }
 guide.grammar_tag:hover {
 	text-decoration: underline;
+}
+
+button.primary {
+    padding: 6px 32px;
+    background-color: var(--link-hover-color);
+    color: var(--btn-hover-color);
+    border-radius: 5px;
 }