IndexController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Admin\Controllers\Veterans;
  3. use App\Http\Controllers\Controller;
  4. use Encore\Admin\Layout\Content;
  5. use Encore\Admin\Facades\Admin;
  6. class IndexController extends Controller
  7. {
  8. /**
  9. * 退役军人招聘岗位管理
  10. * @param Content $content
  11. * @return Content
  12. */
  13. public function index(Content $content)
  14. {
  15. return $content
  16. ->header('退役军人招聘岗位管理')
  17. ->description('')
  18. ->body($this->grid());
  19. }
  20. /**
  21. * 退役军人管理端
  22. * @return void
  23. */
  24. public function manage(){
  25. $data = [
  26. 'type' => 0, // 0=>机构/企业,1是管理员
  27. 'id' => Admin::user()->id, //聚才那边的管理员或者机构ID,我们这边手动绑定
  28. ];
  29. $key = 'jucai2024login00';
  30. $iv = '09koIiJplkqza9Qm';
  31. $code = bin2hex(openssl_encrypt(json_encode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
  32. return redirect("https://tyjr.jucai.gov.cn/admin/#/third_login?code={$code}");
  33. }
  34. /**
  35. * 退役军人管理端
  36. * @return void
  37. */
  38. public function admin(){
  39. $data = [
  40. 'type' => 1, // 0=>机构/企业,1是管理员
  41. 'id' => Admin::user()->id, //聚才那边的管理员或者机构ID,我们这边手动绑定
  42. ];
  43. $key = 'jucai2024login00';
  44. $iv = '09koIiJplkqza9Qm';
  45. $code = bin2hex(openssl_encrypt(json_encode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
  46. return redirect("https://tyjr.jucai.gov.cn/admin/#/third_login?code={$code}");
  47. }
  48. }