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

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

commit d20e4f5c943aa512bb46a6dab46b8cdb5099464d
Author: juzhiyuan <[email protected]>
AuthorDate: Thu Mar 12 10:22:27 2020 +0800

    feat: fake fetchCurrentUser & rewrite dev api
---
 config/proxy.ts      |   4 ++--
 public/favicon.png   | Bin 2849 -> 85376 bytes
 src/services/user.ts |   7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/config/proxy.ts b/config/proxy.ts
index 3fa70dd..e189b0f 100644
--- a/config/proxy.ts
+++ b/config/proxy.ts
@@ -8,9 +8,9 @@
 export default {
   dev: {
     '/api/': {
-      target: 'https://preview.pro.ant.design',
+      target: 'https://apisix.iresty.com/apisix/admin/',
       changeOrigin: true,
-      pathRewrite: { '^': '' },
+      pathRewrite: { '^/api': '' },
     },
   },
   test: {
diff --git a/public/favicon.png b/public/favicon.png
index ece59ce..381ab08 100644
Binary files a/public/favicon.png and b/public/favicon.png differ
diff --git a/src/services/user.ts b/src/services/user.ts
index 1988721..1e5fec8 100644
--- a/src/services/user.ts
+++ b/src/services/user.ts
@@ -5,7 +5,12 @@ export async function query(): Promise<any> {
 }
 
 export async function queryCurrent(): Promise<any> {
-  return request('/api/currentUser');
+  // NOTE: APISIX doesn‘t support user login currently, we return fake data 
directly.
+  return {
+    name: 'APISIX User',
+    avatar: 'favicon.png',
+    userid: '00000001',
+  };
 }
 
 export async function queryNotices(): Promise<any> {

Reply via email to