|
@@ -49,6 +49,7 @@ use App\Services\Project\ProjectTaskGroupViewService;
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Http\Request;
|
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
+use Illuminate\Support\Facades\Cache;
|
|
|
use Illuminate\Support\Facades\Crypt;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Illuminate\Support\Str;
|
|
@@ -655,12 +656,19 @@ class ProjectController extends Controller
|
|
|
}
|
|
|
|
|
|
public function project4s(Request $request){
|
|
|
- $token = $request->headers->get('Authorization');
|
|
|
- // 去除Bearer前缀(如果有的话)
|
|
|
- $token = Str::startsWith($token, 'Bearer ') ? Str::substr($token, 7) : $token;
|
|
|
- $encryptedData = Crypt::encrypt('auth_token'.$token);
|
|
|
+ $key=uniqid();
|
|
|
+ $user=Auth::user();
|
|
|
+ //用户信息放入缓存
|
|
|
+ Cache::put($key, [
|
|
|
+ 'user_id' => $user->id,
|
|
|
+ 'username' => $user->username,
|
|
|
+ 'email' => $user->email,
|
|
|
+ 'phone' => $user->phone,
|
|
|
+ // 'token' => $token,
|
|
|
+ ], now()->addHours(2));
|
|
|
+
|
|
|
return $this->success([
|
|
|
- 'data' => $encryptedData
|
|
|
+ 'data' => $key
|
|
|
]);
|
|
|
}
|
|
|
}
|