wugg vor 1 Jahr
Ursprung
Commit
cc8e14a562
2 geänderte Dateien mit 9 neuen und 4 gelöschten Zeilen
  1. 8 3
      app/controller/User.php
  2. 1 1
      public/index.php

+ 8 - 3
app/controller/User.php

@@ -309,7 +309,12 @@ class User extends Base
         $validate = Validate::rule(['token' => 'require']);
         if ($validate->check($post) == false) return json_show(1004, $validate->getError());
         $getToken = checkToken($post['token'], $this->token_time);
-        return $getToken == false ? json_show(104, "token失效") : json_show(0, "获取成功", $getToken);
+         if( $getToken == false)$this->error('token失效','104');
+        else{
+	           $getToken['system_version']=(new AccountPlat())->where(['account_id'=>$getToken['id']])->column
+	        ('system_version','plat_code');
+        	$this->success('获取成功',$getToken,0);
+        }
     }
 
     /**
@@ -419,7 +424,7 @@ class User extends Base
         $cache = Cache::store('redis')->set("user:info:{$token}", $userinfo, $this->token_time);
         if ($cache == false)$this->error('token保存失败',1003);
         $userinfo['token'] = $token;
-   	 $this->success('获取成功',$userinfo,0);
+   	    $this->success('获取成功',$userinfo,0);
    }
    /**
 	* 系统板本更新
@@ -435,7 +440,7 @@ class User extends Base
     $accountPlat= new AccountPlat();
     $info =$accountPlat->where($param)->findOrEmpty();
     if($info->isEmpty()==false) $this->error('记录信息已存在',1003);
-    $accountPlat->where(["account_id"=>$param['account_id'],"plat_code"=>$param['plat_code']])->delete();
+    $accountPlat->where(["account_id"=>$param['account_id'],"plat_code"=>$param['plat_code']])->select()->delete();
     $pl= $accountPlat->save($param);
     $pl? $this->success('记录成功',[],0): $this->error('记录失败',1003);;
    }

+ 1 - 1
public/index.php

@@ -13,7 +13,7 @@
 namespace think;
 header('Access-Control-Allow-Origin:*');
 header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE');
-header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization,sign,appid,noce,timestamp');
+header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization,sign,appid,noce,timestamp,Web-Auth');
 // 执行HTTP应用并响应
 if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
     echo '';