You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/10/21 01:09:19 UTC

[apisix-dashboard] 01/02: feat: remove unused codes

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-improvment
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git

commit 29ea0ed6f73f3a9cfe0f117822261775c327a6d0
Author: juzhiyuan <ju...@apache.org>
AuthorDate: Wed Oct 21 09:08:36 2020 +0800

    feat: remove unused codes
---
 src/services/login.ts | 36 ------------------------------------
 src/services/user.ts  | 10 ----------
 2 files changed, 46 deletions(-)

diff --git a/src/services/login.ts b/src/services/login.ts
deleted file mode 100644
index 41fb5d2..0000000
--- a/src/services/login.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-export interface LoginParamsType {
-  userName: string;
-  password: string;
-  mobile: string;
-  captcha: string;
-}
-
-export async function fakeAccountLogin(): Promise<API.LoginStateType> {
-  // NOTE: APISIX doesn‘t support user login currently, we return fake data directly.
-  return Promise.resolve({
-    name: 'APISIX User',
-    avatar:
-      'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxzdmcgdmlld0JveD0iMCAwIDUwMCA1MDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQogIDxkZWZzPg0KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0iaWQwIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjI1MTE5LjgiIHkxPSIxMTA1Mi41IiB4Mj0iMjE3MjUuNyIgeTI9IjIxNTUxLjciIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMC4wMjgwOTUsIDAsIDAsIDAuMDI4MDk1LCAtNDkyLjg2NzA5NiwgLTE0NC43Njk4MjEpIj4NCiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29 [...]
-    userid: '00000001',
-    notifyCount: 12,
-    unreadCount: 11,
-    access: 'admin',
-    status: 'ok',
-  });
-}
diff --git a/src/services/user.ts b/src/services/user.ts
index 1929036..ae8c23f 100644
--- a/src/services/user.ts
+++ b/src/services/user.ts
@@ -14,14 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-import { request } from 'umi';
-
 import logo from '@/assets/logo.svg';
 
-export async function query() {
-  return request<API.CurrentUser[]>('/api/users');
-}
-
 export async function queryCurrent(): Promise<API.CurrentUser> {
   return Promise.resolve({
     name: 'APISIX User',
@@ -30,7 +24,3 @@ export async function queryCurrent(): Promise<API.CurrentUser> {
     access: 'admin',
   });
 }
-
-export async function queryNotices(): Promise<any> {
-  return request<{ data: API.NoticeIconData[] }>('/api/notices');
-}