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\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: 1,\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')\"><img :src=\"require(`../../assets/theme/${theme}/image/Union.png`)\"\n                alt=\"\" /></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 :label=\"getRegType(0, true)\" :placeholderText=\"getRegType(activeIndex, false)\" v-model=\"username\"\n            :dialCode=\"dialCode\" @selectArea=\"onSelectArea\" :area=\"isArea\" :icon=\"icon\" />\n        <ExInput style=\"padding-bottom:0!important;\" :label=\"$t('密码')\" :placeholderText=\"$t('请输入您的密码')\" v-model=\"password\"\n            typeText=\"password\" />\n        <div class=\"forget colorMain\" @click=\"$router.push('/forget')\">{{ $t('忘记密码?') }}</div>\n        <div class=\"btn btnMain\" @click=\"verifyLogin\">{{ $t('登录') }}</div>\n        <div class=\"noTips textColor\">{{ $t('还没有账号') }}<span class=\"colorMain\" @click=\"$router.push('/register')\">\n                {{ $t('去注册') }}</span>\n        </div>\n        <nationality-list ref='controlChild' :title=\"$t('选择区域码')\" @getName=\"getName(arguments)\"></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\n    },\n    components: {\n        ExInput,\n        nationalityList\n    },\n    data() {\n        return {\n            username: '',\n            password: \"\",\n            activeIndex: 1  ,\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                        {\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') { this.$toast(this.$t('网络超时!')); }\n                else if (error.msg !== undefined) { this.$toast(this.$t(error.msg)); }\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":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,OAAAA,OAAA;AACA,OAAAC,KAAA;AACA,SAAAC,UAAA,EAAAC,UAAA;AACA,SAAAC,YAAA,EAAAC,UAAA,EAAAC,QAAA;AACA,OAAAC,eAAA;AACA;EACAC,KAAA,GAEA;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;YACA;cACA,KAAAqB,MAAA,MAAAX,EAAA;cACA;YACA;UACA;YACA;cACA,KAAAW,MAAA,MAAAX,EAAA;cACA;YACA;UACA;YACA;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,OAAAE,WAAA,cAAAA,WAAA,aAAAF,QAAA,WAAAA,QAAA;QACAC,QAAA,OAAAA,QAAA;QACAyB,WAAA,OAAAC,UAAA;QACAC,IAAA,OAAAA,IAAA;QACAC,QAAA,OAAAC;MACA,GAAAC,IAAA,CAAAC,GAAA;QACA,KAAAvC,YAAA,CAAAuC,GAAA,CAAAjC,IAAA;QACA,KAAAL,UAAA;QACA,KAAAuC,OAAA,CAAAC,IAAA;MACA,GAAAC,KAAA,CAAAC,KAAA;QACA,IAAAA,KAAA,CAAAC,IAAA;UAAA,KAAAd,MAAA,MAAAX,EAAA;QAAA,OACA,IAAAwB,KAAA,CAAAE,GAAA,KAAAC,SAAA;UAAA,KAAAhB,MAAA,MAAAX,EAAA,CAAAwB,KAAA,CAAAE,GAAA;QAAA;MACA;IACA;EACA;AACA","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}