<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;
use think\Request;

Route::resource(':version/app/Send', 'api/:version.app.Send');//短信
Route::resource(':version/app/User', 'api/:version.app.User');//用户 //注册一个资源路由

//restful方法中另外一个方法等。。。
Route::rule(':version/app/User/login', 'api/:version.app.User/login');//用户登录
Route::rule(':version/app/User/updateToken', 'api/:version.app.User/updateToken');//更新token
Route::rule(':version/app/User/publicLogin', 'api/:version.app.User/publicLogin');//公众号授权
Route::rule(':version/app/User/pointDeal', 'api/:version.app.User/pointDeal');//积分明细
Route::rule(':version/app/User/getShareSign', 'api/:version.app.User/getShareSign');
Route::rule(':version/app/Send/validate', 'api/:version.app.Send/validate');//验证


Route::miss('Error/index');

$request = Request::instance();
if ($request->method() === "OPTIONS") {
    exit (json_encode(array('error' => 200, 'message' => 'Options Success.')));
}

return [
    '__pattern__' => [
        'name' => '\w+',
    ],


];
