zzzz
2024-04-16 273d548631148f99e17b6898d55a867a0ba93a25
1
{"ast":null,"code":"import \"core-js/modules/es.array.push.js\";\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport ExInput from \"@/components/ex-input\";\nimport Axios from \"@/API/login.js\";\nimport { mapActions, mapGetters } from \"vuex\";\nimport { GET_USERINFO, SET_CONFIG, SET_KEFU } from \"@/store/const.store\";\nimport nationalityList from \"../authentication/components/nationalityList.vue\";\nexport default {\n  props: {},\n  components: {\n    ExInput,\n    nationalityList\n  },\n  data() {\n    return {\n      username: \"\",\n      password: \"\",\n      activeIndex: 0,\n      isArea: false,\n      typeText: \"password\",\n      dialCode: 0,\n      //电话号前缀\n      icon: \"\"\n    };\n  },\n  computed: {\n    ...mapGetters({\n      theme: \"home/theme\"\n    })\n  },\n  methods: {\n    ...mapActions(\"user\", [GET_USERINFO, SET_CONFIG]),\n    getRegType(activeIndex, bFlag) {\n      switch (activeIndex) {\n        case 0:\n          return bFlag ? this.$t(\"账号\") : this.$t(\"请输入账号\");\n        case 1:\n          return bFlag ? this.$t(\"邮箱\") : this.$t(\"请输入您的邮箱\");\n        case 2:\n          return bFlag ? this.$t(\"手机号\") : this.$t(\"请输入手机号\");\n      }\n    },\n    onSelectArea() {\n      this.openBtn();\n    },\n    //打开国家列表底部弹窗\n    openBtn() {\n      this.$refs.controlChild.open();\n    },\n    //获取到当前选中国家的code值\n    getName(params) {\n      this.icon = params[1];\n      this.dialCode = params[2];\n    },\n    changeIndex(index) {\n      this.activeIndex = index;\n      switch (index) {\n        case 0:\n        case 1:\n          {\n            this.isArea = false;\n            break;\n          }\n        case 2:\n          {\n            this.isArea = true;\n            break;\n          }\n      }\n    },\n    verifyLogin() {\n      if (this.username == \"\") {\n        switch (this.activeIndex) {\n          case 0:\n            {\n              this.$toast(this.$t(\"请输入账号\"));\n              break;\n            }\n          case 1:\n            {\n              this.$toast(this.$t(\"请输入邮箱\"));\n              break;\n            }\n          case 2:\n            {\n              this.$toast(this.$t(\"请输入手机号\"));\n              break;\n            }\n        }\n        return false;\n      }\n      if (this.password == \"\") {\n        this.$toast(this.$t(\"请输入密码\"));\n        return false;\n      }\n      this.login();\n    },\n    async login() {\n      Axios.loginUser({\n        username: this.activeIndex == 0 || this.activeIndex == 1 ? this.username : `${this.username}`,\n        password: this.password,\n        re_password: this.repassword,\n        type: this.type,\n        usercode: this.invitCode\n      }).then(res => {\n        this.GET_USERINFO(res.data);\n        this.SET_CONFIG(); //获取判断是否乘以杠杆字段\n        this.$router.push(\"/home\");\n      }).catch(error => {\n        if (error.code === \"ECONNABORTED\") {\n          this.$toast(this.$t(\"网络超时!\"));\n        } else if (error.msg !== undefined) {\n          this.$toast(this.$t(error.msg));\n        }\n      });\n    }\n  }\n};","map":{"version":3,"names":["ExInput","Axios","mapActions","mapGetters","GET_USERINFO","SET_CONFIG","SET_KEFU","nationalityList","props","components","data","username","password","activeIndex","isArea","typeText","dialCode","icon","computed","theme","methods","getRegType","bFlag","$t","onSelectArea","openBtn","$refs","controlChild","open","getName","params","changeIndex","index","verifyLogin","$toast","login","loginUser","re_password","repassword","type","usercode","invitCode","then","res","$router","push","catch","error","code","msg","undefined"],"sources":["src/page/login/index.vue"],"sourcesContent":["<template>\n  <div class=\"login\">\n    <div class=\"top\" @click=\"$router.push('/home')\">\n      <img\n        :src=\"require(`../../assets/theme/${theme}/image/Union.png`)\"\n        alt=\"\"\n      />\n    </div>\n    <div class=\"title textColor\">{{ $t(\"登录\") }}</div>\n    <!-- <div class=\"flex login-tab\">\n            <div class=\"textColor1\" :class=\"activeIndex == 1 ? 'active' : ''\" @click=\"changeIndex(1)\">{{ $t('邮箱') }}</div>\n             <div class=\"textColor1\" :class=\"activeIndex == 2 ? 'active' : ''\" @click=\"changeIndex(2)\">{{ $t('手机号') }}</div>\n        </div> -->\n    <ExInput\n      :label=\"getRegType(0, true)\"\n      :placeholderText=\"getRegType(0, false)\"\n      v-model=\"username\"\n      :dialCode=\"dialCode\"\n      @selectArea=\"onSelectArea\"\n      :area=\"isArea\"\n      :icon=\"icon\"\n    />\n    <ExInput\n      style=\"padding-bottom: 0 !important\"\n      :label=\"$t('密码')\"\n      :placeholderText=\"$t('请输入您的密码')\"\n      v-model=\"password\"\n      typeText=\"password\"\n    />\n    <div class=\"forget colorMain\" @click=\"$router.push('/forget')\">\n      {{ $t(\"忘记密码?\") }}\n    </div>\n    <div class=\"btn btnMain\" @click=\"verifyLogin\">{{ $t(\"登录\") }}</div>\n    <div class=\"noTips textColor\">\n      {{ $t(\"还没有账号\")\n      }}<span class=\"colorMain\" @click=\"$router.push('/register')\">\n        {{ $t(\"去注册\") }}</span\n      >\n    </div>\n    <nationality-list\n      ref=\"controlChild\"\n      :title=\"$t('选择区域码')\"\n      @getName=\"getName(arguments)\"\n    ></nationality-list>\n  </div>\n</template>\n\n<script>\nimport ExInput from \"@/components/ex-input\";\nimport Axios from \"@/API/login.js\";\nimport { mapActions, mapGetters } from \"vuex\";\nimport { GET_USERINFO, SET_CONFIG, SET_KEFU } from \"@/store/const.store\";\nimport nationalityList from \"../authentication/components/nationalityList.vue\";\nexport default {\n  props: {},\n  components: {\n    ExInput,\n    nationalityList,\n  },\n  data() {\n    return {\n      username: \"\",\n      password: \"\",\n      activeIndex: 0,\n      isArea: false,\n      typeText: \"password\",\n      dialCode: 0, //电话号前缀\n      icon: \"\",\n    };\n  },\n  computed: {\n    ...mapGetters({\n      theme: \"home/theme\",\n    }),\n  },\n  methods: {\n    ...mapActions(\"user\", [GET_USERINFO, SET_CONFIG]),\n    getRegType(activeIndex, bFlag) {\n      switch (activeIndex) {\n        case 0:\n          return bFlag ? this.$t(\"账号\") : this.$t(\"请输入账号\");\n        case 1:\n          return bFlag ? this.$t(\"邮箱\") : this.$t(\"请输入您的邮箱\");\n        case 2:\n          return bFlag ? this.$t(\"手机号\") : this.$t(\"请输入手机号\");\n      }\n    },\n    onSelectArea() {\n      this.openBtn();\n    },\n    //打开国家列表底部弹窗\n    openBtn() {\n      this.$refs.controlChild.open();\n    },\n    //获取到当前选中国家的code值\n    getName(params) {\n      this.icon = params[1];\n      this.dialCode = params[2];\n    },\n    changeIndex(index) {\n      this.activeIndex = index;\n      switch (index) {\n        case 0:\n        case 1: {\n          this.isArea = false;\n          break;\n        }\n        case 2: {\n          this.isArea = true;\n          break;\n        }\n      }\n    },\n    verifyLogin() {\n      if (this.username == \"\") {\n        switch (this.activeIndex) {\n          case 0: {\n            this.$toast(this.$t(\"请输入账号\"));\n            break;\n          }\n          case 1: {\n            this.$toast(this.$t(\"请输入邮箱\"));\n            break;\n          }\n          case 2: {\n            this.$toast(this.$t(\"请输入手机号\"));\n            break;\n          }\n        }\n        return false;\n      }\n      if (this.password == \"\") {\n        this.$toast(this.$t(\"请输入密码\"));\n        return false;\n      }\n      this.login();\n    },\n    async login() {\n      Axios.loginUser({\n        username:\n          this.activeIndex == 0 || this.activeIndex == 1\n            ? this.username\n            : `${this.username}`,\n        password: this.password,\n        re_password: this.repassword,\n        type: this.type,\n        usercode: this.invitCode,\n      })\n        .then((res) => {\n          this.GET_USERINFO(res.data);\n          this.SET_CONFIG(); //获取判断是否乘以杠杆字段\n          this.$router.push(\"/home\");\n        })\n        .catch((error) => {\n          if (error.code === \"ECONNABORTED\") {\n            this.$toast(this.$t(\"网络超时!\"));\n          } else if (error.msg !== undefined) {\n            this.$toast(this.$t(error.msg));\n          }\n        });\n    },\n  },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.login {\n  width: 100%;\n  padding: 30px;\n  font-size: 26px;\n  box-sizing: border-box;\n}\n\n.top {\n  padding-left: 18px;\n  padding-top: 18px;\n\n  img {\n    width: 37px;\n    height: 37px;\n  }\n}\n\n.title {\n  font-weight: 700;\n  font-size: 52px;\n  margin-top: 54px;\n  margin-bottom: 66px;\n}\n\n.login-tab {\n  margin-bottom: 40px;\n\n  div {\n    padding: 0 40px;\n    height: 68px;\n    line-height: 68px;\n    text-align: center;\n    border-radius: 8px;\n    margin-right: 20px;\n  }\n\n  .active {\n    @include themify() {\n      background: themed(\"tab_background\");\n    }\n\n    @include themify() {\n      color: themed(\"text_color\");\n    }\n  }\n}\n\n.forget {\n  font-size: 24px;\n  line-height: 28px;\n  margin-top: 18px;\n}\n\n.btn {\n  color: #fff;\n  height: 88px;\n  line-height: 88px;\n  text-align: center;\n  font-size: 35px;\n  margin-top: 36px;\n  border-radius: 10px;\n}\n\n.noTips {\n  margin-top: 44px;\n}\n</style>"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,OAAAA,OAAA;AACA,OAAAC,KAAA;AACA,SAAAC,UAAA,EAAAC,UAAA;AACA,SAAAC,YAAA,EAAAC,UAAA,EAAAC,QAAA;AACA,OAAAC,eAAA;AACA;EACAC,KAAA;EACAC,UAAA;IACAT,OAAA;IACAO;EACA;EACAG,KAAA;IACA;MACAC,QAAA;MACAC,QAAA;MACAC,WAAA;MACAC,MAAA;MACAC,QAAA;MACAC,QAAA;MAAA;MACAC,IAAA;IACA;EACA;EACAC,QAAA;IACA,GAAAf,UAAA;MACAgB,KAAA;IACA;EACA;EACAC,OAAA;IACA,GAAAlB,UAAA,UAAAE,YAAA,EAAAC,UAAA;IACAgB,WAAAR,WAAA,EAAAS,KAAA;MACA,QAAAT,WAAA;QACA;UACA,OAAAS,KAAA,QAAAC,EAAA,cAAAA,EAAA;QACA;UACA,OAAAD,KAAA,QAAAC,EAAA,cAAAA,EAAA;QACA;UACA,OAAAD,KAAA,QAAAC,EAAA,eAAAA,EAAA;MACA;IACA;IACAC,aAAA;MACA,KAAAC,OAAA;IACA;IACA;IACAA,QAAA;MACA,KAAAC,KAAA,CAAAC,YAAA,CAAAC,IAAA;IACA;IACA;IACAC,QAAAC,MAAA;MACA,KAAAb,IAAA,GAAAa,MAAA;MACA,KAAAd,QAAA,GAAAc,MAAA;IACA;IACAC,YAAAC,KAAA;MACA,KAAAnB,WAAA,GAAAmB,KAAA;MACA,QAAAA,KAAA;QACA;QACA;UAAA;YACA,KAAAlB,MAAA;YACA;UACA;QACA;UAAA;YACA,KAAAA,MAAA;YACA;UACA;MACA;IACA;IACAmB,YAAA;MACA,SAAAtB,QAAA;QACA,aAAAE,WAAA;UACA;YAAA;cACA,KAAAqB,MAAA,MAAAX,EAAA;cACA;YACA;UACA;YAAA;cACA,KAAAW,MAAA,MAAAX,EAAA;cACA;YACA;UACA;YAAA;cACA,KAAAW,MAAA,MAAAX,EAAA;cACA;YACA;QACA;QACA;MACA;MACA,SAAAX,QAAA;QACA,KAAAsB,MAAA,MAAAX,EAAA;QACA;MACA;MACA,KAAAY,KAAA;IACA;IACA,MAAAA,MAAA;MACAlC,KAAA,CAAAmC,SAAA;QACAzB,QAAA,EACA,KAAAE,WAAA,cAAAA,WAAA,QACA,KAAAF,QAAA,GACA,QAAAA,QAAA;QACAC,QAAA,OAAAA,QAAA;QACAyB,WAAA,OAAAC,UAAA;QACAC,IAAA,OAAAA,IAAA;QACAC,QAAA,OAAAC;MACA,GACAC,IAAA,CAAAC,GAAA;QACA,KAAAvC,YAAA,CAAAuC,GAAA,CAAAjC,IAAA;QACA,KAAAL,UAAA;QACA,KAAAuC,OAAA,CAAAC,IAAA;MACA,GACAC,KAAA,CAAAC,KAAA;QACA,IAAAA,KAAA,CAAAC,IAAA;UACA,KAAAd,MAAA,MAAAX,EAAA;QACA,WAAAwB,KAAA,CAAAE,GAAA,KAAAC,SAAA;UACA,KAAAhB,MAAA,MAAAX,EAAA,CAAAwB,KAAA,CAAAE,GAAA;QACA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}