42 lines
1.1 KiB
PHP
Executable File
42 lines
1.1 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* User: lock
|
|
* Date: 2021/7/28
|
|
* Time: 9:16 AM
|
|
*/
|
|
|
|
namespace app\index\controller;
|
|
|
|
use app\common\classLibrary\ClWechat;
|
|
use tests\thinkphp\library\think\validateTest;
|
|
use think\Controller;
|
|
use think\Request;
|
|
|
|
class ApiAdmin extends Controller
|
|
{
|
|
/**
|
|
* login
|
|
* @return \think\response\Json
|
|
*/
|
|
public function login()
|
|
{
|
|
$result = array();
|
|
$user_name = Request::instance()->param('user_name');
|
|
$password = Request::instance()->param('password');
|
|
$url = config('api_domain').'/admin/login';
|
|
$params = array();
|
|
$params['debug'] = 1;
|
|
$params['user_name'] = $user_name;
|
|
$params['password'] = $password;
|
|
$result_1 = ClWechat::http_post($url,$params);
|
|
$json_arr = json_decode($result_1,true);
|
|
$result['error_code'] = $json_arr['error_code'];
|
|
if ($json_arr['error_code'] == 0)
|
|
{
|
|
session('menu_list',$json_arr['return_total_arr']);
|
|
session('admin',$json_arr['info']);
|
|
}
|
|
return json($result);
|
|
}
|
|
} |