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

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new 309eb1e  [Bugfix] Fix login page rendering error (#126)
309eb1e is described below

commit 309eb1ef916efdf31254a4a38a343a1383e0301c
Author: yangyang zhong <[email protected]>
AuthorDate: Sun Dec 17 10:18:42 2023 +0800

    [Bugfix] Fix login page rendering error (#126)
---
 paimon-web-ui-new/src/api/models/login/index.ts                     | 6 +++---
 .../src/api/models/login/{interface.ts => types/login_options.ts}   | 0
 paimon-web-ui-new/src/router/routes.ts                              | 2 +-
 paimon-web-ui-new/src/views/login/use-form.ts                       | 5 ++---
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/paimon-web-ui-new/src/api/models/login/index.ts 
b/paimon-web-ui-new/src/api/models/login/index.ts
index b29d4e0..f859451 100644
--- a/paimon-web-ui-new/src/api/models/login/index.ts
+++ b/paimon-web-ui-new/src/api/models/login/index.ts
@@ -17,7 +17,7 @@ under the License. */
 
 import httpRequest from '../../request'
 import type { ResponseOptions } from '@/api/types'
-import type { LoginOptions } from './interface'
+import type { LoginOptions } from './types/login_options'
 
 // #region login-controller
 
@@ -25,8 +25,8 @@ import type { LoginOptions } from './interface'
  * # Login
  * @param {LoginOptions} options
  */
-export const onLogin = () => {
-  return httpRequest.post<LoginOptions, ResponseOptions<any>>('/login')
+export const onLogin = (params: LoginOptions) => {
+  return httpRequest.post<LoginOptions, ResponseOptions<any>>('/login', params)
 }
 
 /**
diff --git a/paimon-web-ui-new/src/api/models/login/interface.ts 
b/paimon-web-ui-new/src/api/models/login/types/login_options.ts
similarity index 100%
rename from paimon-web-ui-new/src/api/models/login/interface.ts
rename to paimon-web-ui-new/src/api/models/login/types/login_options.ts
diff --git a/paimon-web-ui-new/src/router/routes.ts 
b/paimon-web-ui-new/src/router/routes.ts
index 3e4da2b..b5ec8a4 100644
--- a/paimon-web-ui-new/src/router/routes.ts
+++ b/paimon-web-ui-new/src/router/routes.ts
@@ -46,7 +46,7 @@ const loginPage: RouteRecordRaw[] = [
   {
     path: '/login',
     name: 'login',
-    component: () => import('../views/login')
+    component: () => import('@/views/login')
   }
 ]
 
diff --git a/paimon-web-ui-new/src/views/login/use-form.ts 
b/paimon-web-ui-new/src/views/login/use-form.ts
index 8225d9d..daf822c 100644
--- a/paimon-web-ui-new/src/views/login/use-form.ts
+++ b/paimon-web-ui-new/src/views/login/use-form.ts
@@ -17,10 +17,10 @@ under the License. */
 
 import type { FormValidationError } from 'naive-ui'
 import type { Router } from 'vue-router'
+import { onLogin } from '@/api'
 
 export function useForm() {
   const router: Router = useRouter()
-  const [userInfo, onSubmit] = onLogin()
 
   const state = reactive({
     loginForm: ref(),
@@ -33,7 +33,7 @@ export function useForm() {
   const handleLogin = () => {
     state.loginForm.validate(async (errors: Array<FormValidationError>) => {
       if (!errors) {
-        await onSubmit({
+        onLogin({
           params: {
             username: state.model.username,
             password: state.model.password,
@@ -41,7 +41,6 @@ export function useForm() {
             rememberMe: true
           }
         })
-        console.log(userInfo)
         router.push({ path: '/' })
       }
     })

Reply via email to