liumiao
2021-02-03 950580629975c2176915c8f0258567617f467349
修改登陆提示
2 files modified
11 ■■■■ changed files
app/Http/Middleware/api/CheckLoginMiddleware.php 8 ●●●● patch | view | raw | blame | history
app/Http/Middleware/api/DecryptParamMiddleware.php 3 ●●●● patch | view | raw | blame | history
app/Http/Middleware/api/CheckLoginMiddleware.php
@@ -22,17 +22,17 @@
    {
        $redis = new CustomRedis();
        $teacherId = $request->teacherId;
        if($teacherId)
        if(is_numeric($teacherId) && $teacherId > 0)
        {
            //处理登录信息
            $loginKey = RedisKey::TEACHER_LOGIN_INFO.'_'.$teacherId;
            $loginKey = RedisKey::TEACHER_LOGIN_INFO . '_' . $teacherId;
            $loginInfo = $redis->get($loginKey);
            $deviceID = $request->deviceID;
            if(!empty($loginInfo))
            {
                //白名单列表后期优化到,缓存文件
                $whiteListStr = env('LOGIN_WHITE_LIST',151611);
                $whiteList = explode(',',$whiteListStr);
                $whiteListStr = env('LOGIN_WHITE_LIST', 151611);
                $whiteList = explode(',', $whiteListStr);
                //有登录信息,判断当前设备
                if($loginInfo['deviceID'] != $deviceID && !in_array($teacherId, $whiteList))
                {
app/Http/Middleware/api/DecryptParamMiddleware.php
@@ -19,10 +19,9 @@
    {
        $param = $request->input('anniParam');
        $param = str_replace(APIKEY, '', $param);
        $param = base64_decode($param, true);
        $param = base64_decode(urldecode($param), true);
        $param = str_replace(APIKEY, '', $param);
        $param = json_decode($param, true);
        if(!is_array($param))
        {
            return apiResponse([], ResponseCode::PARAM_ERROR, '参数缺失.解码失败');