diff --git a/application/admin/controller/Addon.php b/application/admin/controller/Addon.php index a6ae0097..a91bf1ca 100644 --- a/application/admin/controller/Addon.php +++ b/application/admin/controller/Addon.php @@ -367,63 +367,6 @@ class Addon extends Backend return $callback($result); } - /** - * 登录 - */ - public function login() - { - $params = [ - 'account' => $this->request->post('account'), - 'password' => $this->request->post('password'), - 'url' => $this->request->url(true), - 'faversion' => config('fastadmin.version') - ]; - try { - $result = Service::login($params); - } catch (Exception $e) { - $this->error(__($e->getMessage())); - } - return json($result); - } - - /** - * 会员信息 - */ - public function userinfo() - { - $params = [ - 'uid' => $this->request->post('uid'), - 'token' => $this->request->post('token'), - 'url' => $this->request->url(true), - 'faversion' => config('fastadmin.version') - ]; - try { - $result = Service::userinfo($params); - } catch (Exception $e) { - $this->error($e->getMessage()); - } - return json($result); - } - - /** - * 退出 - */ - public function logout() - { - $params = [ - 'uid' => $this->request->post('uid'), - 'token' => $this->request->post('token'), - 'url' => $this->request->url(true), - 'faversion' => config('fastadmin.version') - ]; - try { - $result = Service::logout($params); - } catch (Exception $e) { - $this->error(__($e->getMessage())); - } - return json($result); - } - /** * 检测 */ diff --git a/public/assets/js/backend/addon.js b/public/assets/js/backend/addon.js index bcdc9126..f19bcd2a 100644 --- a/public/assets/js/backend/addon.js +++ b/public/assets/js/backend/addon.js @@ -304,7 +304,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function btn: [__('Login'), __('Register')], yes: function (index, layero) { Fast.api.ajax({ - url: 'addon/login', + url: Config.api_url + '/user/login', type: 'post', data: { account: $("#inputAccount", layero).val(), @@ -338,10 +338,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function }); } else { Fast.api.ajax({ - url: 'addon/userinfo', + url: Config.api_url + '/user/index', data: { uid: userinfo.id, token: userinfo.token, + version: Config.faversion, } }, function (data) { Layer.open({ @@ -352,8 +353,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function btn: [__('Logout'), __('Cancel')], yes: function () { Fast.api.ajax({ - url: 'addon/logout', - data: {uid: userinfo.id, token: userinfo.token} + url: Config.api_url + '/user/logout', + data: {uid: userinfo.id, token: userinfo.token, version: Config.faversion} }, function (data, ret) { Controller.api.userinfo.set(null); Layer.closeAll();