【fix ESLint】src/views/user/alteration
This commit is contained in:
@@ -22,6 +22,7 @@ import Step4 from './Step4'
|
||||
export default {
|
||||
name: 'Alteration',
|
||||
components: {
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
Step1,
|
||||
Step2,
|
||||
Step3,
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
type="text"
|
||||
@change="inputCodeChange"
|
||||
placeholder="请输入验证码">
|
||||
<a-icon slot="prefix" v-if=" inputCodeContent==verifiedCode " type="smile"
|
||||
:style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
<a-icon slot="prefix" v-if=" inputCodeContent===verifiedCode " type="smile"
|
||||
:style="{ color: 'rgba(0,0,0,.25)' }" alt=''/>
|
||||
<a-icon slot="prefix" v-else type="frown" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="10" style="text-align: right">
|
||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
||||
<img v-else style="margin-top: 2px;" src="../../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode" alt=""/>
|
||||
<img v-else style="margin-top: 2px;" src="../../../assets/checkcode.png" @click="handleChangeCheckCode" alt=""/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
||||
@@ -85,10 +85,10 @@ export default {
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
let isPhone = false
|
||||
var params = {}
|
||||
var reg = /^[1-9]\d*$|^0$/
|
||||
var username = values.username
|
||||
if (reg.test(username) == true) {
|
||||
const params = {}
|
||||
const reg = /^[1-9]\d*$|^0$/
|
||||
const username = values.username
|
||||
if (reg.test(username) === true) {
|
||||
params.phone = username
|
||||
isPhone = true
|
||||
} else {
|
||||
@@ -97,7 +97,7 @@ export default {
|
||||
that.validateInputCode().then(() => {
|
||||
getAction('/sys/user/querySysUser', params).then((res) => {
|
||||
if (res.success) {
|
||||
var userList = {
|
||||
const userList = {
|
||||
username: res.result.username,
|
||||
phone: res.result.phone,
|
||||
isPhone: isPhone
|
||||
@@ -107,6 +107,8 @@ export default {
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch(err => {
|
||||
this.$message.error(err.message)
|
||||
})
|
||||
}
|
||||
})
|
||||
@@ -120,8 +122,7 @@ export default {
|
||||
if (res.success) {
|
||||
resolve()
|
||||
} else {
|
||||
this.$message.error(res.message)
|
||||
reject()
|
||||
reject(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -129,7 +130,9 @@ export default {
|
||||
inputCodeChange (e) {
|
||||
this.inputCodeContent = e.target.value
|
||||
console.log(this.inputCodeContent)
|
||||
if (!e.target.value || e.target.value == 0) {
|
||||
// TODO eslint:这里value是字符串,不会等于数字0
|
||||
// if (!e.target.value || e.target.value == 0) {
|
||||
if (!e.target.value) {
|
||||
this.inputCodeNull = true
|
||||
} else {
|
||||
this.inputCodeContent = this.inputCodeContent.toLowerCase()
|
||||
@@ -142,14 +145,14 @@ export default {
|
||||
},
|
||||
validateInputUsername (rule, value, callback) {
|
||||
console.log(value)
|
||||
var reg = /^[0-9]+.?[0-9]*/
|
||||
const reg = /^[0-9]+.?[0-9]*/
|
||||
if (!value) {
|
||||
callback(new Error('请输入用户名和手机号!'))
|
||||
}
|
||||
|
||||
// 判断用户输入账号还是手机号码
|
||||
if (reg.test(value)) {
|
||||
var phoneParams = {
|
||||
const phoneParams = {
|
||||
phone: value
|
||||
}
|
||||
checkOnlyUser(phoneParams).then((res) => {
|
||||
@@ -160,7 +163,7 @@ export default {
|
||||
}
|
||||
})
|
||||
} else {
|
||||
var usernameParams = {
|
||||
const usernameParams = {
|
||||
username: value
|
||||
}
|
||||
checkOnlyUser(usernameParams).then((res) => {
|
||||
|
||||
@@ -84,17 +84,17 @@ export default {
|
||||
this.form.validateFields((err, values) => {
|
||||
console.log(values)
|
||||
if (!err) {
|
||||
if (that.dropList == '0') {
|
||||
if (values.captcha == undefined) {
|
||||
if ((that.dropList + '') === '0') {
|
||||
if (values.captcha === undefined) {
|
||||
this.cmsFailed('请输入短信验证码!')
|
||||
} else {
|
||||
var params = {}
|
||||
const params = {}
|
||||
params.phone = values.phone
|
||||
params.smscode = values.captcha
|
||||
postAction('/sys/user/phoneVerification', params).then((res) => {
|
||||
if (res.success) {
|
||||
console.log(res)
|
||||
var userList = {
|
||||
const userList = {
|
||||
username: res.result.username,
|
||||
phone: values.phone,
|
||||
smscode: res.result.smscode
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
})
|
||||
},
|
||||
handleChangeSelect (value) {
|
||||
var that = this
|
||||
const that = this
|
||||
console.log(value)
|
||||
if (value === 0) {
|
||||
that.dropList = '0'
|
||||
@@ -161,7 +161,7 @@ export default {
|
||||
},
|
||||
validatePhone (rule, value, callback) {
|
||||
if (value) {
|
||||
var myreg = /^[1][3,4,5,7,8][0-9]{9}$/
|
||||
const myreg = /^1[34578][0-9]{9}$/
|
||||
if (!myreg.test(value)) {
|
||||
callback(new Error('请输入正确的手机号'))
|
||||
} else {
|
||||
|
||||
@@ -59,7 +59,7 @@ export default {
|
||||
password: {
|
||||
rules: [{
|
||||
required: true,
|
||||
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/,
|
||||
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/,
|
||||
message: '密码由8位数字、大小写字母和特殊符号组成!!'
|
||||
}, { validator: this.handlePasswordLevel }]
|
||||
},
|
||||
@@ -73,14 +73,14 @@ export default {
|
||||
that.loading = true
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
var params = {}
|
||||
const params = {}
|
||||
params.username = this.userList.username
|
||||
params.password = values.password
|
||||
params.smscode = this.userList.smscode
|
||||
params.phone = this.userList.phone
|
||||
getAction('/sys/user/passwordChange', params).then((res) => {
|
||||
if (res.success) {
|
||||
var userList = {
|
||||
const userList = {
|
||||
username: this.userList.username
|
||||
}
|
||||
console.log(userList)
|
||||
|
||||
@@ -37,9 +37,9 @@ export default {
|
||||
setInterval(that.countDown, 1000)
|
||||
},
|
||||
watch: {
|
||||
time: function (newVal, oldVal) {
|
||||
time: function (newVal/* , oldVal */) {
|
||||
if (newVal === 0) {
|
||||
var params = {
|
||||
const params = {
|
||||
username: this.userList.username
|
||||
}
|
||||
this.$router.push({ name: 'login', params })
|
||||
|
||||
Reference in New Issue
Block a user