| | |
| | | //注册用户 |
| | | /// |
| | | const registerUser = (params) => { |
| | | return requestHttp({ |
| | | url: "api/user/register", |
| | | method: "post", |
| | | return httpJson({ |
| | | // url: "api/user/register", |
| | | url: "api/localuser!registerNoVerifcode", |
| | | method: "get", |
| | | isLoading: true, |
| | | data: objectToFormData(params), |
| | | // data: objectToFormData(params), |
| | | params, |
| | | }); |
| | | }; |
| | | //登录 |
| | |
| | | "是否认购": "是否认购", |
| | | "USDC充值": "USDC充值", |
| | | "BNB充值": "BNB充值", |
| | | "記住帳戶密碼": "記住帳戶密碼", |
| | | "请先实名认证!": "请先实名认证!", |
| | | "请不要向任何人透露密码、短信和谷歌验证码,包括交易所工作人员。": "请不要向任何人透露密码、短信和谷歌验证码,包括交易所工作人员。" |
| | | } |
| | |
| | | v-model="password" |
| | | typeText="password" |
| | | /> |
| | | <div class="forget colorMain" @click="$router.push('/forget')"> |
| | | {{ $t("忘记密码?") }} |
| | | </div> |
| | | <div class="remember" data-v-8cc76a7b=""> |
| | | <van-checkbox @change="checkboxChange" v-model="checked">{{ |
| | | $t("記住帳戶密碼") |
| | | }}</van-checkbox> |
| | | <div |
| | | style=" |
| | | display: flex; |
| | | justify-content: space-between; |
| | | align-items: center; |
| | | margin-top: 10px; |
| | | " |
| | | > |
| | | <div class="forget colorMain" @click="$router.push('/forget')"> |
| | | {{ $t("忘记密码?") }} |
| | | </div> |
| | | <div class="remember" data-v-8cc76a7b=""> |
| | | <van-checkbox @change="checkboxChange" v-model="checked">{{ |
| | | $t("記住帳戶密碼") |
| | | }}</van-checkbox> |
| | | </div> |
| | | </div> |
| | | <div class="btn btnMain" @click="verifyLogin">{{ $t("登录") }}</div> |
| | | <div class="noTips textColor"> |
| | |
| | | icon: "", |
| | | }; |
| | | }, |
| | | mounted() { |
| | | const ret = window.localStorage.getItem("login_admin"); |
| | | this.checked = window.localStorage.getItem("login_checked") === "true"; |
| | | console.log(ret, this.checked); |
| | | if (ret && this.checked) { |
| | | this.password = JSON.parse(ret).password; |
| | | this.username = JSON.parse(ret).username; |
| | | } |
| | | }, |
| | | activated() { |
| | | const ret = window.localStorage.getItem("login_admin"); |
| | | this.checked = window.localStorage.getItem("login_checked") === "true"; |
| | | console.log(ret, this.checked); |
| | | if (ret && this.checked) { |
| | | this.password = JSON.parse(ret).password; |
| | | this.username = JSON.parse(ret).username; |
| | | } else { |
| | | this.password = ""; |
| | | this.username = ""; |
| | | } |
| | | }, |
| | | computed: { |
| | | ...mapGetters({ |
| | | theme: "home/theme", |
| | |
| | | }, |
| | | methods: { |
| | | ...mapActions("user", [GET_USERINFO, SET_CONFIG]), |
| | | checkboxChange(e) {}, |
| | | checkboxChange(e) { |
| | | window.localStorage.setItem("login_checked", e); |
| | | }, |
| | | getRegType(activeIndex, bFlag) { |
| | | switch (activeIndex) { |
| | | case 0: |
| | |
| | | password: this.password, |
| | | }) |
| | | .then((res) => { |
| | | if (this.checked) { |
| | | window.localStorage.setItem( |
| | | "login_admin", |
| | | JSON.stringify({ |
| | | username: this.username, |
| | | password: this.password, |
| | | }) |
| | | ); |
| | | } else { |
| | | window.localStorage.setItem("login_admin", ""); |
| | | } |
| | | |
| | | this.GET_USERINFO(res.data); |
| | | this.SET_CONFIG(); //获取判断是否乘以杠杆字段 |
| | | this.$router.push("/home"); |
| | |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | ::v-deep .van-icon { |
| | | width: 1.3rem; |
| | | height: 1.3rem; |
| | | } |
| | | ::v-deep .van-checkbox__icon { |
| | | height: auto; |
| | | } |
| | | .login { |
| | | width: 100%; |
| | | padding: 30px; |
| | |
| | | /> |
| | | <ExInput |
| | | :placeholderText="$t('请确认密码')" |
| | | v-model="form.rePassword" |
| | | v-model="form.re_password" |
| | | typeText="password" |
| | | /> |
| | | <ExInput |
| | |
| | | code: "", |
| | | username: "", |
| | | password: "", |
| | | rePassword: "", |
| | | re_password: "", |
| | | usercode: "", |
| | | }, |
| | | show: false, |
| | |
| | | onClose() { |
| | | console.log("onClose"); |
| | | }, |
| | | onSuccess() { |
| | | console.log("onSuccess"); |
| | | this.registerApi(); |
| | | async onSuccess() { |
| | | this.show = false; |
| | | this.registerApi(); |
| | | // AxiosuserCenter.invitationCode({ |
| | | // email: this.form.email, |
| | | // verificationCode: this.form.code, |
| | | // code: this.form.usercode, |
| | | // }).then((res) => { |
| | | // if (res.code == 0) { |
| | | // this.registerApi(); |
| | | // } else { |
| | | // this.$toast(this.$t(res.msg)); |
| | | // } |
| | | // }); |
| | | }, |
| | | onFail() { |
| | | this.msg = ""; |
| | |
| | | this.$toast(this.$t("请输入密码")); |
| | | return; |
| | | } |
| | | if (this.form.password !== this.form.rePassword) { |
| | | if (this.form.password !== this.form.re_password) { |
| | | this.$toast(this.$t("密码不一致")); |
| | | return; |
| | | } |
| | |
| | | this.$toast(this.$t("请输入邀请码")); |
| | | return; |
| | | } |
| | | |
| | | if (!this.agree) { |
| | | this.$toast(this.$t("请同意服务条款")); |
| | | return; |
| | |
| | | Axios.registerUser({ |
| | | ...this.form, |
| | | type: 2, |
| | | em: this.form.email, |
| | | }) |
| | | .then((res) => { |
| | | console.log(res, "======="); |