|
@@ -3,6 +3,7 @@ namespace app\newhome\controller;
|
|
|
|
|
|
use think\Controller;
|
|
|
use app\user\model\UserSkill;
|
|
|
+use think\Config;
|
|
|
|
|
|
class User extends Controller {
|
|
|
|
|
@@ -55,9 +56,16 @@ class User extends Controller {
|
|
|
public function load(){
|
|
|
$data = decode($this->request->post());
|
|
|
$id = $data['u'];
|
|
|
+
|
|
|
$path = "load/$id.txt";
|
|
|
|
|
|
- $res = $this->userModel->getUserById($id);
|
|
|
+ if(!is_file($path)) return json(['error'=>1005]);
|
|
|
+
|
|
|
+ if(strlen($id) > 10){
|
|
|
+ $res = $this->userModel->getUserById($id);
|
|
|
+ }else{
|
|
|
+ $res = $this->userModel->getUserByCode($id);
|
|
|
+ }
|
|
|
|
|
|
$file = fopen($path, "r") or die(json(['error'=>1009]));
|
|
|
$info = fread($file, filesize($path));
|
|
@@ -106,7 +114,7 @@ class User extends Controller {
|
|
|
public function look(){
|
|
|
$res = $this->userModel->lookList();
|
|
|
|
|
|
- return json(['l'=>$res]);
|
|
|
+ return $res;
|
|
|
}
|
|
|
|
|
|
public function nickname(){
|