【fix ESLint】src/views/user
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
autocomplete="false"
|
||||
placeholder="请输入密码"
|
||||
>
|
||||
<a-icon title="显示密码" @click="passwordType='text'" slot="suffix" v-if="passwordType=='password'" type="eye" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||
<a-icon title="显示密码" @click="passwordType='text'" slot="suffix" v-if="passwordType==='password'" type="eye" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||
<a-icon title="隐藏密码" @click="passwordType='password'" slot="suffix" v-else type="eye-invisible" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||
<a-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||
</a-input>
|
||||
@@ -37,7 +37,7 @@
|
||||
</a-col>
|
||||
<a-col :span="3"></a-col>
|
||||
</a-row>
|
||||
<a-row style="margin-bottom: 0%;">
|
||||
<a-row style="margin-bottom: 0;">
|
||||
<a-col :span="3"></a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item>
|
||||
@@ -53,8 +53,8 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="6" 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-col :span="3"></a-col>
|
||||
</a-row>
|
||||
@@ -138,8 +138,8 @@
|
||||
</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-row>
|
||||
@@ -181,12 +181,12 @@
|
||||
import { mapActions } from 'vuex'
|
||||
import { timeFix } from '@/utils/util'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN, ENCRYPTED_STRING, USER_INFO } from '@/store/mutation-types'
|
||||
import { putAction, postAction, getAction } from '@/api/manage'
|
||||
import { ACCESS_TOKEN/* , ENCRYPTED_STRING, USER_INFO */ } from '@/store/mutation-types'
|
||||
import { /* putAction, */ postAction, getAction } from '@/api/manage'
|
||||
|
||||
import { getRSAPublicKey } from '@/utils/encryption.js'
|
||||
import { JSEncrypt } from 'jsencrypt'
|
||||
const Base64 = require('js-base64').Base64
|
||||
// const Base64 = require('js-base64').Base64
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
@@ -255,7 +255,7 @@ export default {
|
||||
loginParams.username = encrypt.encrypt(values.username)
|
||||
loginParams.password = encrypt.encrypt(values.password)
|
||||
// 登录
|
||||
that.Login(loginParams).then((res) => {
|
||||
that.Login(loginParams).then((/* res */) => {
|
||||
this.loginSuccess()
|
||||
}).catch((err) => {
|
||||
if (err.code === 500) {
|
||||
@@ -331,7 +331,7 @@ export default {
|
||||
})
|
||||
},
|
||||
loginSuccess () {
|
||||
this.$router.push({ path: '/' }).catch((res) => {})
|
||||
this.$router.push({ path: '/' }).catch((/* res */) => {})
|
||||
this.$notification.success({
|
||||
message: '欢迎',
|
||||
description: `${timeFix()},欢迎回来`
|
||||
@@ -356,13 +356,15 @@ export default {
|
||||
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('您的手机号码格式不正确!')
|
||||
}
|
||||
},
|
||||
validateInputCode (rule, value, callback) {
|
||||
if (!value || this.verifiedCode == this.inputCodeContent) {
|
||||
if (!value || this.verifiedCode === this.inputCodeContent) {
|
||||
callback()
|
||||
} else {
|
||||
// eslint-disable-next-line standard/no-callback-literal
|
||||
callback('您输入的验证码不正确!')
|
||||
}
|
||||
},
|
||||
@@ -385,27 +387,27 @@ export default {
|
||||
}
|
||||
// 判断当前设备
|
||||
function isMobile () {
|
||||
var userAgentInfo = navigator.userAgent
|
||||
const userAgentInfo = navigator.userAgent
|
||||
|
||||
var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
|
||||
const mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
|
||||
|
||||
var mobile_flag = false
|
||||
let mobileFlag = false
|
||||
|
||||
// 根据userAgent判断是否是手机
|
||||
for (var v = 0; v < mobileAgents.length; v++) {
|
||||
for (let v = 0; v < mobileAgents.length; v++) {
|
||||
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
|
||||
mobile_flag = true
|
||||
mobileFlag = true
|
||||
break
|
||||
}
|
||||
}
|
||||
var screen_width = window.screen.width
|
||||
var screen_height = window.screen.height
|
||||
const screenWidth = window.screen.width
|
||||
const screenHeight = window.screen.height
|
||||
|
||||
// 根据屏幕分辨率判断是否是手机
|
||||
if (screen_width < 500 && screen_height < 800) {
|
||||
mobile_flag = true
|
||||
if (screenWidth < 500 && screenHeight < 800) {
|
||||
mobileFlag = true
|
||||
}
|
||||
return mobile_flag
|
||||
return mobileFlag
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user