Commit e04c49b8 authored by shajiaiming's avatar shajiaiming

用户信息

parent 74f6c883
......@@ -92,7 +92,7 @@ class LoginForm extends Model
}
/**
* Finds user by [[username]]
* Finds user by [[token]]
*
* @return User|null
*/
......
......@@ -55,4 +55,11 @@ class TrusteeShipService
return $this->send("GET", $uri, $params);
}
public function getWalletBalance($params = [])
{
$uri = 'backend/account/wallet-balance';
return $this->send("GET", $uri, $params);
}
}
......@@ -36,6 +36,21 @@ class UserController extends BaseController
return ['code' => $code, 'msg' => $msg, 'data' => $data];
}
public function actionUserInfo()
{
$msg = 'ok';
$code = 0;
$token_string = Yii::$app->request->headers->get('Token');
$user = Admin::findIdentityByAccessToken($token_string);
$data = [
'username' => $user->username,
'uid' => isset($user->bind_uid) ? $user->bind_uid : $user->uid,
'type' => isset($user->bind_uid) ? 2 : 1
];
doEnd :
return ['code' => $code, 'msg' => $msg, 'data' => $data];
}
/**
* 用户同步
*/
......
......@@ -2,6 +2,7 @@
namespace wallet\controllers;
use common\service\trusteeship\TrusteeShipService;
use Yii;
use common\models\Admin;
use wallet\base\BaseController;
......@@ -21,4 +22,17 @@ class WalletController extends BaseController
return ['code' => 0, 'msg' => 'ok', 'data' => $platforms];
}
public function actionWalletBallance()
{
$type = Yii::$app->request->get('type', 1);
$currency = Yii::$app->request->get('currency ', '');
$params = [
'type' => $type,
'currency' => $currency
];
$service = new TrusteeShipService();
$result = $service->getWalletBalance($params);
return ['code' => 1, 'data' => $result, 'msg' => 'success'];
}
}
\ No newline at end of file
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