<?php
namespace app\index\controller;

use think\Controller;

/**
 * 公共类
 */
class Common extends Controller
{


    /**
     * 验证apiToken
     *
     * @access public
     * @return string
     */
    protected function verifyApiToken()
    {
        $request     = \think\Request::instance();
        $getApiToken = input('server.HTTP_apiToken');
        $action      = $request->action();
        $controller  = $request->controller();
        $module      = $request->module();
        $apiToken    = md5(strtolower($action.'Customer-Service'.$controller.strtotime(date('Y-m-d')).$module));
        //print_r([strtolower($action.'Customer-Service'.$controller.strtotime(date('Y-m-d')).$module),$apiToken, $getApiToken]);die;
        if ($getApiToken === $apiToken) {
            return true;
        } else {
            return false;
        }

    }//end verifyApiToken()


}
