ThinkPHP接收header自定义参数

// 请求拦截,配置Token等参数
Vue.prototype.$u.http.interceptor.request = (config) => {
config.header['content-type'] = 'application/x-www-form-urlencoded'
config.header.token = uni.getStorageSync('token') || ''
return config
}
function __construct() {
	parent::__construct();
	$paylod = (new Jwt)->verifyToken(I('SERVER.HTTP_TOKEN'));
	$this->currentUserId = (int)$paylod['user_id'];
}

posted on 2022-12-24 10:36  小馬過河﹎  阅读(814)  评论(0)    收藏  举报

导航