// 请求拦截,配置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'];
}
标签:__,自定义,paylod,header,ThinkPHP,config
From: https://www.cnblogs.com/sunr/p/17002470.html