QueryParamAuth::className(), 'tokenParam' => 'token', ] ]); } /** * 刷新用户信息 * @return array * @author nodelog */ public function actionRefresh() { // request()->setQueryParams(['expand' => 'profile,qrcode,count,countMenu']); return ['data' => User::findOne(Yii::$app->user->id)]; } /** * 设置产业链 * @return string[] * @throws ServerErrorHttpException * @author nodelog */ public function actionSetChain() { $model = Yii::$app->user->identity; if (!empty($model->chain)) { return ['errcode' => CodeEnum::CODE_ERROR, 'errmsg' => '您已设置产业分类,无需重复设置']; } $chain = request('chain'); $model->chain = $chain; $model->save(); if ($model->hasErrors()) { throw new ServerErrorHttpException(current($model->getErrors())[0]); } return ['errmsg' => '设置成功']; } }