Browse Source

合并提交

master
j1ack 3 years ago
parent
commit
ca303ea27a
  1. 2
      manifest.json
  2. 32
      pages/login/register.vue
  3. 9
      utils/axios.js

2
manifest.json

@ -51,7 +51,7 @@
"devServer" : { "devServer" : {
// "port" : 8083, // "port" : 8083,
"disableHostCheck" : true, "disableHostCheck" : true,
"https" : true, "https" : false,
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"ws" : false, "ws" : false,

32
pages/login/register.vue

@ -88,6 +88,7 @@
<script> <script>
import UButton from '../../uview-ui/components/u-button/u-button.vue' import UButton from '../../uview-ui/components/u-button/u-button.vue'
import api from '@/utils/api'
export default { export default {
name: "register", name: "register",
data() { data() {
@ -109,37 +110,37 @@
payPassword: { payPassword: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.withdrawalPasswordMessage"), message: this.$t("login").withdrawalPasswordMessage,
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
email: { email: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.emailInputMessage"), message: this.$t("login").emailInputMessage,
trigger: ["blur", "change"], trigger: ["blur", "change"],
}, },
code: { code: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.verificationCodeMessage"), message: this.$t("login").verificationCodeMessage,
trigger: ["blur", "change"] trigger: ["blur", "change"]
}, },
password: { password: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.passwordInputMessage"), message: this.$t("login").passwordInputMessage,
trigger: ["blur", "change"] trigger: ["blur", "change"]
}, },
InvitationCode: { InvitationCode: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.InvitationCodeMessage"), message: this.$t("login").InvitationCodeMessage,
trigger: ["blur", "change"] trigger: ["blur", "change"]
}, },
confirmPassword: { confirmPassword: {
type: "string", type: "string",
required: true, required: true,
message: this.$t("login.confirmPasswordMessage"), message: this.$t("login").confirmPasswordMessage,
trigger: ["blur", "change"] trigger: ["blur", "change"]
}, },
@ -171,11 +172,11 @@
// //
getCode() { getCode() {
if (!this.userInfo.email) { if (!this.userInfo.email) {
uni.$u.toast(this.$t("login.Emailempty")) uni.$u.toast(this.$t("login").Emailempty)
return return
} }
if (!this.isCanGetCode) { if (!this.isCanGetCode) {
uni.$u.toast(this.$t("login.Emailincorrect")) uni.$u.toast(this.$t("login").Emailincorrect)
return return
} }
if (this.$refs.uCode.canGetCode) { if (this.$refs.uCode.canGetCode) {
@ -185,13 +186,14 @@
} }
// //
uni.showLoading({ uni.showLoading({
title: this.$t("login.GettingVerificationCode") title: this.$t("login").GettingVerificationCode
}) })
this.$api.sendEmailCode(data).then(res => { console.log(123)
if (res.code === 200) { api.sendEmailCode(data).then(res => {
uni.hideLoading(); if (res.errCode === 'SUCCESS') {
uni.hideLoading(this.$t("login").CodeHasSent);
// this.start() // this.start()
uni.$u.toast(this.$t("login.CodeHasSent")); uni.$u.toast(this.$t("login").CodeHasSent);
// //
this.$refs.uCode.start(); this.$refs.uCode.start();
} else { } else {
@ -199,7 +201,7 @@
} }
}) })
} else { } else {
uni.$u.toast(this.$t("login.SendAfter")); uni.$u.toast(this.$t("login").SendAfter);
} }
}, },
// //
@ -209,7 +211,7 @@
if (res.errCode === 'SUCCESS') { if (res.errCode === 'SUCCESS') {
setTimeout(() => { setTimeout(() => {
uni.showToast({ uni.showToast({
title: this.$t("login.resSuccess") title: this.$t("login").resSuccess
}) })
}, 600) }, 600)
uni.switchTab({ uni.switchTab({

9
utils/axios.js

@ -66,11 +66,7 @@ service.interceptors.request.use(
} }
if (config.method == 'post') { if (config.method == 'post') {
console.log(config.data) dataStr = decodeURIComponent(qs.stringify(config.data)).split('&');
dataStr = qs.stringify(config.data).split('&');
} }
//console.log(config.url,111111,config.data,dataStr) //console.log(config.url,111111,config.data,dataStr)
config.data = {}; config.data = {};
@ -105,7 +101,7 @@ service.interceptors.request.use(
}); });
key = "key=" + constant.KEY; var key = "key=" + constant.KEY;
console.log(sign + key) console.log(sign + key)
@ -135,6 +131,7 @@ service.interceptors.request.use(
service.interceptors.response.use(res => { service.interceptors.response.use(res => {
console.log('过期了吗', res) console.log('过期了吗', res)
uni.hideLoading() uni.hideLoading()
res=res.data;
// console.log(res) // console.log(res)
// console.log(res.data) // console.log(res.data)
// console.log(res.data.data[0].nameAlias) // console.log(res.data.data[0].nameAlias)

Loading…
Cancel
Save