Ben Lin
2024-04-25 fa77d6fcb0b770edc33c65ee9b947c34af2c3bf9
src/views/sys/login/LoginForm.vue
@@ -27,7 +27,7 @@
    <FormItem name="dept" class="enter-x dept">
      <ARow class="enter-x">
        <ACol :md="24" :xs="24" :span="24">
           <BasicForm @register="registerForm" />
          <BasicForm @register="registerForm" />
        </ACol>
      </ARow>
    </FormItem>
@@ -57,14 +57,13 @@
      </Button>
    </FormItem>
  </Form>
</template>
<script lang="ts" setup>
  import { reactive, ref, unref, computed, onMounted,h } from 'vue';
  import { reactive, ref, unref, computed, onMounted, h } from 'vue';
  import { BasicForm, useForm } from '/@/components/Form/index';
  import { Checkbox, Form, Input, Row, Col, Button, Select, Divider } from 'ant-design-vue';
  import LoginFormTitle from './LoginFormTitle.vue';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { useMessage } from '/@/hooks/web/useMessage';
@@ -75,11 +74,9 @@
  import { AccountInfo } from '/@/api/tigerapi/model/systemModel';
  import { accountFormSchema } from './loginDept.data';
  import { getTreeList, optionsListApi } from '/@/api/tigerapi/dept';
  //import { onKeyStroke } from '@vueuse/core';
  const ACol = Col;
  const ARow = Row;
  const FormItem = Form.Item;
@@ -132,12 +129,12 @@
  async function handleLogin() {
    const data = await validForm();
    const orgData = await validate();
    console.log('data',data)
    console.log('data', data);
    if (!data) return;
    try {
      loading.value = true;
      //const positionInfo = await getUserIpConfig();
      const Info = { ad_info: {}, ip: '' } //positionInfo.status === 110 ? { ad_info: {}, ip: '' } : positionInfo.result;
      const Info = { ad_info: {}, ip: '' }; //positionInfo.status === 110 ? { ad_info: {}, ip: '' } : positionInfo.result;
      const accountInfo: AccountInfo = {
        useR_CODE: data.account,
        password: data.password,
@@ -145,7 +142,7 @@
        ad_info: Info.ad_info,
        ip: Info.ip,
      };
      const userInfo = await userStore.login({
        id: 'string',
        dataType: 'string',
@@ -159,14 +156,12 @@
          description: `${t('sys.login.loginSuccessDesc')}: ${userInfo.realName}`,
          duration: 3,
        });
      }else{
      } else {
        createErrorModal({
        title: t('sys.api.errorTip'),
        content: t('sys.api.errMsg401'),
        getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body,
      });
          title: t('sys.api.errorTip'),
          content: t('sys.api.errMsg401'),
          getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body,
        });
      }
    } catch (error) {
      createErrorModal({
@@ -181,8 +176,8 @@
  }
</script>
<style lang="less" scoped>
  .dept{
    /deep/.ant-select-selector{
  .dept {
    /deep/.ant-select-selector {
      height: 37px !important;
    }
    /deep/.ant-select-single .ant-select-selector {