Commit e51aa794 authored by wangzhengwen's avatar wangzhengwen

exp update

parent 7f445908
...@@ -15,6 +15,12 @@ class AddExperience ...@@ -15,6 +15,12 @@ class AddExperience
// 获取当前控制器和方法(格式如:user/login) // 获取当前控制器和方法(格式如:user/login)
$fullAction = strtolower($request->controller() . '/' . $request->action()); $fullAction = strtolower($request->controller() . '/' . $request->action());
$LonginAction = ['user/login','Wecaht/checkwxlogin','user/bindmobile'];
if (in_array($fullAction, $LonginAction))
{
$fullAction = 'user/login';
}
// 获取经验规则 // 获取经验规则
$rule = Db::name('user_exp_rule') $rule = Db::name('user_exp_rule')
->where('action', $fullAction) ->where('action', $fullAction)
...@@ -35,15 +41,12 @@ class AddExperience ...@@ -35,15 +41,12 @@ class AddExperience
// 特殊处理登录方法(需解析 token 获取 userId) // 特殊处理登录方法(需解析 token 获取 userId)
if ($fullAction === 'user/login') { if ($fullAction === 'user/login') {
$token = $responseData['data']['token'] ?? null; $token = $responseData['data']['token'] ?? null;
if (!$token) {
return $response;
}
} else { } else {
// 普通方法直接从 header 获取 token // 普通方法直接从 header 获取 token
$token = $request->header('token'); $token = $request->header('token');
if (!$token) { }
return $response; if (!$token) {
} return $response;
} }
$userId = Db::name('user') $userId = Db::name('user')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment