wangsizhu0504 commented on code in PR #1859:
URL: 
https://github.com/apache/incubator-streampark/pull/1859#discussion_r998079918


##########
streampark-console/streampark-console-newui/src/views/base/login/LoginForm.vue:
##########
@@ -144,24 +135,90 @@
   //onKeyStroke('Enter', handleLogin);
 
   const getShow = computed(() => unref(getLoginState) === 
LoginStateEnum.LOGIN);
-
+  async function createTeamModal(): Promise<void> {
+    // let teamId = '';
+    // const teamList: Array<Recordable> = await getTeamList({});
+    // console.log('teamList', teamList);
+    // const { createConfirm, createMessage } = useMessage();
+    // createConfirm({
+    //   iconType: 'warning',
+    //   title: () => {
+    //     return (
+    //       <div>
+    //         <Icon icon="ant-design:setting-outlined" />
+    //         <span>Select Team</span>
+    //       </div>
+    //     );
+    //   },
+    //   content: () => {
+    //     return (
+    //       <div>
+    //         <Icon icon="ant-design:setting-outlined" />
+    //         <Select value={teamId} onChange={(value: string) => (teamId = 
value)}>
+    //           {teamList.map((team: Recordable) => {
+    //             return <Select.Option 
value={team.id}>{team.teamName}</Select.Option>;
+    //           })}
+    //         </Select>
+    //       </div>
+    //     );
+    //   },
+    //   onOk: () => {
+    //     if (!teamId) {
+    //       createMessage.warning('please select a team');
+    //       return Promise.reject();
+    //     }
+    //     this.setTeamId(teamId);
+    //     return Promise.resolve();
+    //   },
+    // });
+  }
   async function handleLogin() {
-    const data = await validForm();
-    if (!data) return;
+    const loginFormValue = await validForm();
+    if (!loginFormValue) return;
     try {
       loading.value = true;
-      const userInfo = await userStore.login({
-        password: data.password,
-        username: data.account,
-        mode: 'none', //不要默认的错误提示
-      });
-
-      userInfo &&
-        notification.success({
-          message: t('sys.login.loginSuccessTitle'),
-          description: `${t('sys.login.loginSuccessDesc')}: 
${userInfo.nickName}`,
-          duration: 3,
-        });
+      const { createMessage } = useMessage();
+      // const { t } = useI18n();
+      try {
+        const { data } = await loginApi(
+          {
+            password: loginFormValue.password,
+            username: loginFormValue.account,
+          },
+          'none',
+        );
+
+        const { code } = data;
+        if (code != null && code != undefined) {
+          if (code == 0 || code == 1) {
+            const message =
+              'SignIn failed,' +
+              (code === 0 ? ' authentication error' : ' current User is 
locked.');
+            createMessage.error(message);

Review Comment:
   4444



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to