在验证类里面加上public $uid=Cookie::get('uid')
这句话就会报错 这是为什么?cookie不能这样用吗?
<?php
namespace app\index\validate;
use think\Validate;
use think\facade\Cookie;
class User extends Validate
{
public $uid=Cookie::get('uid');
protected $rule = [
'uid' => 'number|between:1,120',
];
}
BIG阳
泛舟湖上清波郎朗
莫回无