1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace App\Admin\Controllers\Veterans;
- use App\Http\Controllers\Controller;
- use Encore\Admin\Auth\Permission;
- use Encore\Admin\Layout\Content;
- use Encore\Admin\Facades\Admin;
- class IndexController extends Controller
- {
- /**
- * 退役军人招聘岗位管理
- * @param Content $content
- * @return Content
- */
- public function index(Content $content)
- {
- return $content
- ->header('退役军人招聘岗位管理')
- ->description('')
- ->body($this->grid());
- }
- /**
- * 退役军人管理端
- * @return void
- */
- public function manage(){
- Permission::check('veterans_manage');
- if(Admin::user()->id == 1){
- $data = [
- 'type' => 1, // 0=>机构/企业,1是管理员
- 'id' => Admin::user()->id, //聚才那边的管理员或者机构ID,我们这边手动绑定
- ];
- }else{
- $data = [
- 'type' => 0, // 0=>机构/企业,1是管理员
- 'id' => Admin::user()->id, //聚才那边的管理员或者机构ID,我们这边手动绑定
- ];
- }
- $key = 'jucai2024login00';
- $iv = '09koIiJplkqza9Qm';
- $code = bin2hex(openssl_encrypt(json_encode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
- return redirect("https://tyjr.jucai.gov.cn/admin/#/third_login?code={$code}");
- }
- /**
- * 退役军人管理端
- * @return void
- */
- public function admin(){
- Permission::check('veterans_admin');
- $data = [
- 'type' => 1, // 0=>机构/企业,1是管理员
- 'id' => Admin::user()->id, //聚才那边的管理员或者机构ID,我们这边手动绑定
- ];
- $key = 'jucai2024login00';
- $iv = '09koIiJplkqza9Qm';
- $code = bin2hex(openssl_encrypt(json_encode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
- return redirect("https://tyjr.jucai.gov.cn/admin/#/third_login?code={$code}");
- }
- }
|