deletemsg
This commit is contained in:
@@ -32,8 +32,7 @@
|
||||
</u-form-item>
|
||||
<u-form-item v-if="active <= 1 && !isPwdLogin" label="" prop="verificationCode">
|
||||
<u-input v-model="loginInfo.verificationCode" border="surround" placeholder="请输入验证码">
|
||||
<view class="code_btn" slot="suffix" @click="getCode">
|
||||
{{ count !== 0 ? `${count} s` : "获取验证码" }}
|
||||
<view class="code_btn" slot="suffix" @click="getCode">{{ count !== 0 ? `${count} s` : "获取验证码" }}
|
||||
</view>
|
||||
</u-input>
|
||||
</u-form-item>
|
||||
@@ -218,12 +217,13 @@ export default {
|
||||
return;
|
||||
}
|
||||
|
||||
const options = {
|
||||
phoneNumber: this.loginInfo.phoneNumber,
|
||||
region: `+${this.loginInfo.region}`,
|
||||
usedFor: SmsUserFor.Login,
|
||||
operationID: Date.now() + "",
|
||||
};
|
||||
const options = {
|
||||
mobile: this.loginInfo.phoneNumber,
|
||||
email: this.loginInfo.email,
|
||||
region: `+${this.loginInfo.region}`,
|
||||
event: "login",
|
||||
type:"mobile"
|
||||
};
|
||||
businessSendSms(options)
|
||||
.then(() => {
|
||||
uni.$u.toast("验证码已发送!");
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<view class="set_password_container content_with_back">
|
||||
<view class="title">重置密码</view>
|
||||
<u-form class="loginForm commonPage-form" labelPosition="top" :model="formData" :rules="rules" :labelStyle="{
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
minWidth: '200rpx',
|
||||
}" ref="loginForm">
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
minWidth: '200rpx',
|
||||
}" ref="loginForm">
|
||||
<u-form-item label="密码" prop="password">
|
||||
<u-input v-model="formData.password" border="surround" placeholder="请输入密码" :password="!passwordEying">
|
||||
<u-icon @click="updateEye('passwordEying')" slot="suffix"
|
||||
@@ -60,7 +60,7 @@
|
||||
validator: (rule, value, callback) => {
|
||||
return value.length >= 6;
|
||||
},
|
||||
message: "密码太短",
|
||||
message: "密码太过于简单",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<view class="set_info_container content_with_back">
|
||||
<view class="title">设置信息</view>
|
||||
<u-form class="loginForm commonPage-form" labelPosition="top" :model="userInfo" :rules="rules" :labelStyle="{
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
minWidth: '200rpx',
|
||||
}" ref="loginForm">
|
||||
fontSize: '14px',
|
||||
marginTop: '20rpx',
|
||||
minWidth: '200rpx',
|
||||
}" ref="loginForm">
|
||||
<u-form-item label="昵称" prop="nickname">
|
||||
<u-input v-model="userInfo.nickname" border="surround" placeholder="请输入您的昵称" clearable>
|
||||
</u-input>
|
||||
@@ -37,8 +37,8 @@
|
||||
import md5 from "md5";
|
||||
import MyAvatar from "@/components/MyAvatar/index.vue";
|
||||
import { mapGetters } from "vuex";
|
||||
import { businessRegister } from "@/api/login";
|
||||
import { checkLoginError } from "@/util/common";
|
||||
import {businessRegister} from "@/api/login";
|
||||
import {checkLoginError } from "@/util/common";
|
||||
import util from "@/util/index.js"
|
||||
export default {
|
||||
components: {
|
||||
@@ -62,10 +62,11 @@
|
||||
nickname: [{
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请填写真实姓名",
|
||||
message: "请填写您的昵称",
|
||||
trigger: ["blur", "change"],
|
||||
}, ],
|
||||
password: [{
|
||||
password: [
|
||||
{
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入密码",
|
||||
@@ -76,20 +77,20 @@
|
||||
validator: (rule, value, callback) => {
|
||||
return value.length >= 6;
|
||||
},
|
||||
message: "密码太短",
|
||||
message: "密码太过于简单",
|
||||
trigger: ["change", "blur"],
|
||||
},
|
||||
],
|
||||
confirmPassword: [{
|
||||
type: "string",
|
||||
required: true,
|
||||
message: "请输入确认密码",
|
||||
message: "请再次输入密码",
|
||||
trigger: ["blur", "change"],
|
||||
pattern: /^(?=.*\d)(?=.*[a-zA-Z]).{6,}$/,
|
||||
},
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
return value === this.formData.password;
|
||||
return value === this.userInfo.password;
|
||||
},
|
||||
message: "两次密码不一致",
|
||||
trigger: ["change", "blur"],
|
||||
@@ -103,15 +104,17 @@
|
||||
},
|
||||
onLoad(options) {
|
||||
const {userInfo,codeValue} = options;
|
||||
this.userInfo = {
|
||||
...this.userInfo,
|
||||
...util.aesdecode(userInfo),
|
||||
};
|
||||
if(userInfo){
|
||||
this.userInfo = {
|
||||
...this.userInfo,
|
||||
...util.aesdecode(userInfo),
|
||||
};
|
||||
}
|
||||
this.codeValue = codeValue;
|
||||
if(process.env.NODE_ENV == 'development'){
|
||||
//this.userInfo.email = "commiu@outlook.com";
|
||||
this.userInfo.nickname = "";
|
||||
this.userInfo.password = "qwe123";
|
||||
this.userInfo.password = "qwe1231";
|
||||
this.userInfo.confirmPassword = "qwe123";
|
||||
}
|
||||
},
|
||||
@@ -129,37 +132,46 @@
|
||||
}
|
||||
});
|
||||
},
|
||||
async doRegister() {
|
||||
this.loading = true;
|
||||
const options = {
|
||||
code: this.codeValue,
|
||||
platform: uni.$u.os(),
|
||||
autoLogin: true,
|
||||
...this.userInfo,
|
||||
region: `+${this.userInfo.region}`,
|
||||
password: md5(this.userInfo.password),
|
||||
mobile: this.userInfo.mobile
|
||||
};
|
||||
try {
|
||||
await businessRegister(options);
|
||||
this.saveLoginInfo();
|
||||
uni.$u.toast('注册成功')
|
||||
uni.$u.route("/pages/common/login/index")
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
if(err.msg=="验证码过期" || err.msg=="验证码错误"){
|
||||
const s = util.aesencode(this.userInfo);
|
||||
uni.$u.route("/pages/common/verifyCode/index", {
|
||||
userInfo: s,
|
||||
isRegister: true,
|
||||
resend: 1,
|
||||
})
|
||||
return ;
|
||||
doRegister() {
|
||||
const _this = this;
|
||||
this.$refs.loginForm.validate().then(async (res) => {
|
||||
_this.loading = true;
|
||||
console.log(res);
|
||||
const options = {
|
||||
code: _this.codeValue,
|
||||
platform: uni.$u.os(),
|
||||
autoLogin: true,
|
||||
..._this.userInfo,
|
||||
region: `+${_this.userInfo.region}`,
|
||||
password: md5(_this.userInfo.password),
|
||||
mobile: _this.userInfo.mobile
|
||||
};
|
||||
try {
|
||||
await businessRegister(options);
|
||||
_this.saveLoginInfo();
|
||||
uni.$u.toast('注册成功')
|
||||
uni.$u.route("/pages/common/login/index")
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
if(err.msg=="验证码过期" || err.msg=="验证码错误"){
|
||||
const s = util.aesencode(_this.userInfo);
|
||||
uni.$u.route("/pages/common/verifyCode/index", {
|
||||
userInfo: s,
|
||||
isRegister: true,
|
||||
resend: 1,
|
||||
})
|
||||
return ;
|
||||
}
|
||||
// uni.$u.toast('注册失败')
|
||||
} finally {
|
||||
_this.loading = false;
|
||||
}
|
||||
// uni.$u.toast('注册失败')
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
uni.$u.toast('校验通过')
|
||||
}).catch(errors => {
|
||||
console.log(errors);
|
||||
uni.$u.toast('校验失败')
|
||||
});
|
||||
return ;
|
||||
},
|
||||
saveLoginInfo() {
|
||||
uni.setStorage({
|
||||
@@ -176,7 +188,6 @@
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.set_info_container {
|
||||
margin-top: var(--status-bar-height);
|
||||
background: linear-gradient(180deg,
|
||||
rgba(0, 137, 255, 0.1) 0%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
|
||||
Reference in New Issue
Block a user