|
|
@ -6,26 +6,19 @@ |
|
|
|
<h1>欢迎使用开发者平台</h1> |
|
|
|
<h1>欢迎使用开发者平台</h1> |
|
|
|
<div class="form"> |
|
|
|
<div class="form"> |
|
|
|
<ul class="tab"> |
|
|
|
<ul class="tab"> |
|
|
|
<li v-for="(item, i) in tabList" :key="i" :class="{active: activeIndex == item.id}" @click="handleSelect(item.id)">{{item.label}}</li> |
|
|
|
<li v-for="(item, i) in tabList" :key="i" :class="{ active: activeIndex == item.id }" |
|
|
|
|
|
|
|
@click="handleSelect(item.id)">{{ item.label }}</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
<el-form v-show="activeIndex==='1'" :model="param" :rules="rules" ref="login" label-width="0px"> |
|
|
|
<el-form v-show="activeIndex === '1'" :model="param" :rules="rules" ref="login" label-width="0px"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input> |
|
|
|
<el-input @blur="blur" v-model="param.account" placeholder="请输入账号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-input |
|
|
|
<el-input type="password" placeholder="请输入密码" v-model="param.password"> |
|
|
|
type="password" |
|
|
|
|
|
|
|
placeholder="请输入密码" |
|
|
|
|
|
|
|
v-model="param.password" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="code" v-if="showVerify"> |
|
|
|
<el-form-item prop="code" v-if="showVerify"> |
|
|
|
<el-input |
|
|
|
<el-input placeholder="请输入验证码" v-model="param.code" @keyup.enter.native="submitForm()"> |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
v-model="param.code" |
|
|
|
|
|
|
|
@keyup.enter.native="submitForm()" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
<img @click="blur" :src="verificationIMG" class="verification" alt=""> |
|
|
|
<img @click="blur" :src="verificationIMG" class="verification" alt=""> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -34,24 +27,17 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-form v-show="activeIndex==='2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" label-width="0px"> |
|
|
|
<el-form v-show="activeIndex === '2'" :model="phoneOrEmail" :rules="phoneOrEmailrules" ref="phoneOrEmail" |
|
|
|
|
|
|
|
label-width="0px"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<el-form-item prop="account"> |
|
|
|
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input> |
|
|
|
<el-input @blur="phoneBlur" v-model="phoneOrEmail.account" placeholder="请输入电话/邮箱"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-form-item prop="password"> |
|
|
|
<el-input |
|
|
|
<el-input type="password" placeholder="请输入密码" v-model="phoneOrEmail.password"> |
|
|
|
type="password" |
|
|
|
|
|
|
|
placeholder="请输入密码" |
|
|
|
|
|
|
|
v-model="phoneOrEmail.password" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="code" v-if="showPhoneVerify"> |
|
|
|
<el-form-item prop="code" v-if="showPhoneVerify"> |
|
|
|
<el-input |
|
|
|
<el-input placeholder="请输入验证码" v-model="phoneOrEmail.code" @keyup.enter.native="submitForm('phone')"> |
|
|
|
placeholder="请输入验证码" |
|
|
|
|
|
|
|
v-model="phoneOrEmail.code" |
|
|
|
|
|
|
|
@keyup.enter.native="submitForm('phone')" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
</el-input> |
|
|
|
</el-input> |
|
|
|
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt=""> |
|
|
|
<img @click="phoneBlur" :src="PhoneVerificationIMG" class="verification" alt=""> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
@ -71,7 +57,8 @@ |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<el-form-item label="验证码"> |
|
|
|
<div style="display:flex;"> |
|
|
|
<div style="display:flex;"> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-input v-model="phoneCode" placeholder="请输入验证码" maxlength="6"></el-input> |
|
|
|
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{phoneBtnText}}</el-button> |
|
|
|
<el-button style="margin-left:10px" @click="sendPhoneCode" :disabled="phoneDisabled">{{ phoneBtnText |
|
|
|
|
|
|
|
}}</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-form> |
|
|
@ -80,6 +67,20 @@ |
|
|
|
<el-button type="primary" @click="phoneSubmit">确 定</el-button> |
|
|
|
<el-button type="primary" @click="phoneSubmit">确 定</el-button> |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="请选择您要登录的用户" :visible.sync="userVisible" :close-on-click-modal="false" custom-class="user-dia" |
|
|
|
|
|
|
|
width="500px"> |
|
|
|
|
|
|
|
<p class="tips">该手机号已绑定以下用户信息</p> |
|
|
|
|
|
|
|
<ul class="users"> |
|
|
|
|
|
|
|
<li :class="{ isEnable: !user.isEnable }" v-for="(user, i) in users" :key="i" @click="chooseUser(user)"> |
|
|
|
|
|
|
|
<span>{{ user.schoolName }},{{ user.userName }},{{ user.workNumber }}{{ |
|
|
|
|
|
|
|
user.isEnable |
|
|
|
|
|
|
|
? '' |
|
|
|
|
|
|
|
: '(已禁用)' }}</span> |
|
|
|
|
|
|
|
<i class="el-icon-right"></i> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
</el-dialog> |
|
|
|
<v-footer class="footer" ref="footer"></v-footer> |
|
|
|
<v-footer class="footer" ref="footer"></v-footer> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -87,14 +88,17 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import vFooter from '../components/Footer' |
|
|
|
import vFooter from '../components/Footer' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
|
|
|
|
import addRoutes from '@/libs/route/addRoutes' |
|
|
|
|
|
|
|
import CryptoJS from 'crypto-js' |
|
|
|
|
|
|
|
import JSEncrypt from 'jsencrypt' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data: function() { |
|
|
|
data: function () { |
|
|
|
var regPhoneOrEmail = (rule, value, callback) => {// 验证手机或邮箱 |
|
|
|
var regPhoneOrEmail = (rule, value, callback) => {// 验证手机或邮箱 |
|
|
|
let emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ |
|
|
|
let emailReg = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/ |
|
|
|
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ |
|
|
|
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ |
|
|
|
if (value === '') { |
|
|
|
if (value === '') { |
|
|
|
callback(new Error('请输入手机或邮箱!')); |
|
|
|
callback(new Error('请输入手机或邮箱!')); |
|
|
|
} else if (!emailReg.test(value)&&!phoneReg.test(value)) { |
|
|
|
} else if (!emailReg.test(value) && !phoneReg.test(value)) { |
|
|
|
callback(new Error('输入的手机/邮箱格式不正确!')); |
|
|
|
callback(new Error('输入的手机/邮箱格式不正确!')); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
callback(); |
|
|
|
callback(); |
|
|
@ -110,19 +114,19 @@ export default { |
|
|
|
label: '手机号/邮箱登录' |
|
|
|
label: '手机号/邮箱登录' |
|
|
|
} |
|
|
|
} |
|
|
|
], |
|
|
|
], |
|
|
|
activeIndex:"1", |
|
|
|
activeIndex: "1", |
|
|
|
|
|
|
|
|
|
|
|
showVerify: true,// 账号-验证码展示 |
|
|
|
showVerify: true,// 账号-验证码展示 |
|
|
|
verificationIMG:'',// 账号验证码拼接链接 |
|
|
|
verificationIMG: '',// 账号验证码拼接链接 |
|
|
|
|
|
|
|
|
|
|
|
// 账号 |
|
|
|
// 账号 |
|
|
|
param: { |
|
|
|
param: { |
|
|
|
account: '', |
|
|
|
account: '', |
|
|
|
password: '', |
|
|
|
password: '', |
|
|
|
code:'', |
|
|
|
code: '', |
|
|
|
platform:3, |
|
|
|
platform: 3, |
|
|
|
random:'', |
|
|
|
random: '', |
|
|
|
distinguish:1, |
|
|
|
distinguish: 1, |
|
|
|
type: 2 |
|
|
|
type: 2 |
|
|
|
}, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
rules: { |
|
|
@ -132,84 +136,89 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 手机+邮箱 |
|
|
|
// 手机+邮箱 |
|
|
|
showPhoneVerify:true,// 邮箱-验证码展示 |
|
|
|
showPhoneVerify: true,// 邮箱-验证码展示 |
|
|
|
PhoneVerificationIMG:'',// 电话或邮箱验证码拼接链接 |
|
|
|
PhoneVerificationIMG: '',// 电话或邮箱验证码拼接链接 |
|
|
|
phoneOrEmail: { |
|
|
|
phoneOrEmail: { |
|
|
|
account: '', |
|
|
|
account: '', |
|
|
|
password: '', |
|
|
|
password: '', |
|
|
|
code:'', |
|
|
|
code: '', |
|
|
|
platform:3, |
|
|
|
platform: 3, |
|
|
|
random:'', |
|
|
|
random: '', |
|
|
|
distinguish:2, |
|
|
|
distinguish: 2, |
|
|
|
type: 2 |
|
|
|
type: 2 |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneOrEmailrules:{ |
|
|
|
phoneOrEmailrules: { |
|
|
|
account: [{ validator: regPhoneOrEmail, trigger: 'blur' }], |
|
|
|
account: [{ validator: regPhoneOrEmail, trigger: 'blur' }], |
|
|
|
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
|
|
|
password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
|
|
|
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }], |
|
|
|
code: [{ required: true, message: '请输入验证码', trigger: 'blur' }], |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
phoneVisible:false, |
|
|
|
phoneVisible: false, |
|
|
|
phone:'', |
|
|
|
phone: '', |
|
|
|
phoneCode:'', |
|
|
|
phoneCode: '', |
|
|
|
phoneDisabled:false, |
|
|
|
phoneDisabled: false, |
|
|
|
phoneBtnText: '发送验证码', |
|
|
|
phoneBtnText: '发送验证码', |
|
|
|
phoneTimer:'', |
|
|
|
phoneTimer: '', |
|
|
|
phoneOpener:'' |
|
|
|
phoneOpener: '', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userVisible: false, |
|
|
|
|
|
|
|
users: [], |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
|
vFooter |
|
|
|
vFooter |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
watch: { |
|
|
|
verificationIMG:function(val){// 监听账号--展示验证码框 |
|
|
|
verificationIMG: function (val) {// 监听账号--展示验证码框 |
|
|
|
if(val){ |
|
|
|
if (val) { |
|
|
|
this.showVerify = true |
|
|
|
this.showVerify = true |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.showVerify = false |
|
|
|
this.showVerify = false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
PhoneVerificationIMG:function(val){// 监听账号--展示验证码框 |
|
|
|
PhoneVerificationIMG: function (val) {// 监听账号--展示验证码框 |
|
|
|
if(val){ |
|
|
|
if (val) { |
|
|
|
this.showPhoneVerify = true |
|
|
|
this.showPhoneVerify = true |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.showPhoneVerify = false |
|
|
|
this.showPhoneVerify = false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
created(){ |
|
|
|
created () { |
|
|
|
if(this.param.account){ |
|
|
|
if (this.param.account) { |
|
|
|
this.showVerify = true |
|
|
|
this.showVerify = true |
|
|
|
} |
|
|
|
} |
|
|
|
this.blur() |
|
|
|
this.blur() |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
submitForm(val) { |
|
|
|
submitForm (val) { |
|
|
|
let ref = val==='phone'?'phoneOrEmail':'login' |
|
|
|
let ref = val === 'phone' ? 'phoneOrEmail' : 'login' |
|
|
|
let param = val==='phone'?this.phoneOrEmail:this.param |
|
|
|
let param = val === 'phone' ? this.phoneOrEmail : this.param |
|
|
|
this.$refs[ref].validate(valid => { |
|
|
|
this.$refs[ref].validate(valid => { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
this.$post(this.api.logins,param).then(res => { |
|
|
|
this.$post(this.api.logins, param).then(({ status, data, message }) => { |
|
|
|
const { message } = res |
|
|
|
localStorage.removeItem('examPath') |
|
|
|
sessionStorage.setItem('token',res.data.token) |
|
|
|
localStorage.removeItem('reviewPath') |
|
|
|
this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`).then(res => { |
|
|
|
this.getOss() |
|
|
|
const list = res.permissionMenu |
|
|
|
if (status == 200) { |
|
|
|
this.$store.commit('setDataPer', res.dataPermissionList) |
|
|
|
const accounts = data.userAccounts |
|
|
|
this.$message.success(message); |
|
|
|
// 如果返回的是数组,则弹框给用户选择登录哪个用户,否则,直接登录 |
|
|
|
this.$router.push({ |
|
|
|
if (accounts instanceof Array) { |
|
|
|
path: list[0].children[0].path |
|
|
|
this.users = accounts |
|
|
|
}); |
|
|
|
this.userVisible = true |
|
|
|
localStorage.setItem('ms_username', this.param.username); |
|
|
|
} else { |
|
|
|
}).catch(err => { |
|
|
|
sessionStorage.setItem('token', data.token) |
|
|
|
if (err.status === 500) { |
|
|
|
this.setLogin() |
|
|
|
sessionStorage.clear() |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
param.code = '' |
|
|
|
|
|
|
|
this.$message.error(message) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
if(err.status===30001){ |
|
|
|
if (err.status === 30001) { |
|
|
|
this.phoneVisible = true |
|
|
|
this.phoneVisible = true |
|
|
|
}else if(err.status == 10004){ |
|
|
|
} else if (err.status == 10004 || err.status == 10005) { |
|
|
|
|
|
|
|
param.code = '' |
|
|
|
this.blur() |
|
|
|
this.blur() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -218,17 +227,64 @@ export default { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取oss信息 |
|
|
|
|
|
|
|
async getOss () { |
|
|
|
|
|
|
|
const A = (key, encryptedData) => { |
|
|
|
|
|
|
|
const keyHex = CryptoJS.enc.Base64.parse(key) |
|
|
|
|
|
|
|
const decrypted = CryptoJS.AES.decrypt(encryptedData, keyHex, { |
|
|
|
|
|
|
|
mode: CryptoJS.mode.ECB, |
|
|
|
|
|
|
|
padding: CryptoJS.pad.Pkcs7 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
return decrypted.toString(CryptoJS.enc.Utf8) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const R = (encryptedKey, privateKey) => { |
|
|
|
|
|
|
|
const decrypt = new JSEncrypt() |
|
|
|
|
|
|
|
decrypt.setPrivateKey(privateKey) |
|
|
|
|
|
|
|
const decryptedKey = decrypt.decrypt(encryptedKey) |
|
|
|
|
|
|
|
return decryptedKey |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const res = await this.$get(this.api.encrypt) |
|
|
|
|
|
|
|
const RE = A(R(res.encryptedKey, res.privateKey), res.encryptedData).split('/') |
|
|
|
|
|
|
|
localStorage.setItem('osc', JSON.stringify(RE)) |
|
|
|
}, |
|
|
|
}, |
|
|
|
blur(){ |
|
|
|
// 选择用户回调 |
|
|
|
this.param.random = Math.floor(Math.random()*999999999) |
|
|
|
chooseUser (user) { |
|
|
|
this.verificationIMG = this.api.verification+'?random='+`${this.param.random}` |
|
|
|
user.isEnable && this.$post(`${this.api.getToken}?id=${user.id}`).then(({ data }) => { |
|
|
|
|
|
|
|
sessionStorage.setItem('token', data.token) |
|
|
|
|
|
|
|
this.token = data.token |
|
|
|
|
|
|
|
this.setLogin() |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneBlur(){ |
|
|
|
// 处理登录成功 |
|
|
|
this.phoneOrEmail.random = Math.floor(Math.random()*999999999) |
|
|
|
async setLogin () { |
|
|
|
this.PhoneVerificationIMG = this.api.verification+'?random='+`${this.phoneOrEmail.random}` |
|
|
|
try { |
|
|
|
|
|
|
|
const res = await this.$get(`${this.api.getUserRolesPermissionMenu}?platformId=${Setting.platformId}`) |
|
|
|
|
|
|
|
const list = res.permissionMenu |
|
|
|
|
|
|
|
addRoutes(res.permissionMenu[0].children) |
|
|
|
|
|
|
|
this.$store.commit('setDataPer', res.dataPermissionList) |
|
|
|
|
|
|
|
this.$message.success('登录成功!') |
|
|
|
|
|
|
|
this.$router.push({ |
|
|
|
|
|
|
|
path: list[0].children[0].path |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
localStorage.setItem('ms_username', this.param.username); |
|
|
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
if (e.status === 500) { |
|
|
|
|
|
|
|
sessionStorage.clear() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
blur () { |
|
|
|
|
|
|
|
this.param.random = Math.floor(Math.random() * 999999999) |
|
|
|
|
|
|
|
this.verificationIMG = this.api.verification + '?random=' + `${this.param.random}` |
|
|
|
}, |
|
|
|
}, |
|
|
|
handleSelect(val){ |
|
|
|
phoneBlur () { |
|
|
|
|
|
|
|
this.phoneOrEmail.random = Math.floor(Math.random() * 999999999) |
|
|
|
|
|
|
|
this.PhoneVerificationIMG = this.api.verification + '?random=' + `${this.phoneOrEmail.random}` |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleSelect (val) { |
|
|
|
this.activeIndex = val |
|
|
|
this.activeIndex = val |
|
|
|
this.param.account = ""; |
|
|
|
this.param.account = ""; |
|
|
|
this.param.password = ""; |
|
|
|
this.param.password = ""; |
|
|
@ -240,27 +296,27 @@ export default { |
|
|
|
// this.blur() |
|
|
|
// this.blur() |
|
|
|
this.phoneBlur() |
|
|
|
this.phoneBlur() |
|
|
|
}, |
|
|
|
}, |
|
|
|
sendPhoneCode(){ |
|
|
|
sendPhoneCode () { |
|
|
|
if(!this.phone) return this.$message.warning('请输入手机号') |
|
|
|
if (!this.phone) return this.$message.warning('请输入手机号') |
|
|
|
if(!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号') |
|
|
|
if (!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号') |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
phone: this.phone, |
|
|
|
phone: this.phone, |
|
|
|
types: 2 |
|
|
|
types: 2 |
|
|
|
} |
|
|
|
} |
|
|
|
this.$post(this.api.sendPhoneOrEmailCode,data).then(res => { |
|
|
|
this.$post(this.api.sendPhoneOrEmailCode, data).then(res => { |
|
|
|
this.phoneCountdown()// 倒计时 |
|
|
|
this.phoneCountdown()// 倒计时 |
|
|
|
if(res.message.opener){ |
|
|
|
if (res.message.opener) { |
|
|
|
this.phoneOpener = res.message.opener |
|
|
|
this.phoneOpener = res.message.opener |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.$message(res.message) |
|
|
|
this.$message(res.message) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneSubmit(){ |
|
|
|
phoneSubmit () { |
|
|
|
if(!this.phone) return this.$message.warning('请输入手机号') |
|
|
|
if (!this.phone) return this.$message.warning('请输入手机号') |
|
|
|
if(!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号') |
|
|
|
if (!/^1[3456789]\d{9}$/.test(this.phone)) return this.$message.warning('请输入正确的手机号') |
|
|
|
if(!this.phoneCode) return this.$message.warning('请输入验证码') |
|
|
|
if (!this.phoneCode) return this.$message.warning('请输入验证码') |
|
|
|
let data = { |
|
|
|
let data = { |
|
|
|
phone: this.phone, |
|
|
|
phone: this.phone, |
|
|
|
types: 2, |
|
|
|
types: 2, |
|
|
@ -269,32 +325,32 @@ export default { |
|
|
|
platform: 3, |
|
|
|
platform: 3, |
|
|
|
account: this.param.account |
|
|
|
account: this.param.account |
|
|
|
} |
|
|
|
} |
|
|
|
this.$post(this.api.bindPhoneOrEmail,data).then(res => { |
|
|
|
this.$post(this.api.bindPhoneOrEmail, data).then(res => { |
|
|
|
sessionStorage.setItem('token',res.token) |
|
|
|
sessionStorage.setItem('token', res.token) |
|
|
|
this.$router.push({ |
|
|
|
this.$router.push({ |
|
|
|
path:'/customer' |
|
|
|
path: '/customer' |
|
|
|
}); |
|
|
|
}); |
|
|
|
localStorage.setItem('ms_username', this.param.username); |
|
|
|
localStorage.setItem('ms_username', this.param.username); |
|
|
|
this.$message.success('绑定成功') |
|
|
|
this.$message.success('绑定成功') |
|
|
|
// this.form.phone = this.phone |
|
|
|
// this.form.phone = this.phone |
|
|
|
// this.phoneVisible = false |
|
|
|
// this.phoneVisible = false |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
phoneCountdown(){ |
|
|
|
phoneCountdown () { |
|
|
|
let count = 60 |
|
|
|
let count = 60 |
|
|
|
if(!this.phoneTimer){ |
|
|
|
if (!this.phoneTimer) { |
|
|
|
this.phoneDisabled = true |
|
|
|
this.phoneDisabled = true |
|
|
|
this.phoneTimer = setInterval(() => { |
|
|
|
this.phoneTimer = setInterval(() => { |
|
|
|
if(count > 0){ |
|
|
|
if (count > 0) { |
|
|
|
count-- |
|
|
|
count-- |
|
|
|
this.phoneBtnText = `${count}秒后重试` |
|
|
|
this.phoneBtnText = `${count}秒后重试` |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
this.phoneDisabled = false |
|
|
|
this.phoneDisabled = false |
|
|
|
clearInterval(this.phoneTimer) |
|
|
|
clearInterval(this.phoneTimer) |
|
|
|
this.phoneTimer = null |
|
|
|
this.phoneTimer = null |
|
|
|
this.phoneBtnText = `发送验证码` |
|
|
|
this.phoneBtnText = `发送验证码` |
|
|
|
} |
|
|
|
} |
|
|
|
},1000) |
|
|
|
}, 1000) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
@ -305,24 +361,28 @@ export default { |
|
|
|
.wrap { |
|
|
|
.wrap { |
|
|
|
min-height: 100%; |
|
|
|
min-height: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.logo { |
|
|
|
.logo { |
|
|
|
z-index: 2; |
|
|
|
z-index: 2; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 50px; |
|
|
|
top: 50px; |
|
|
|
left: 50px; |
|
|
|
left: 50px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login { |
|
|
|
.login { |
|
|
|
position: relative; |
|
|
|
position: relative; |
|
|
|
height: 100%; |
|
|
|
height: 100%; |
|
|
|
background-image: url(../assets/img/devLogin.jpg); |
|
|
|
background-image: url(../assets/img/devLogin.jpg); |
|
|
|
background-size: 100%; |
|
|
|
background-size: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.box { |
|
|
|
.box { |
|
|
|
width: 448px; |
|
|
|
width: 448px; |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
right: 20%; |
|
|
|
right: 20%; |
|
|
|
top: 50%; |
|
|
|
top: 50%; |
|
|
|
transform: translateY(-50%); |
|
|
|
transform: translateY(-50%); |
|
|
|
|
|
|
|
|
|
|
|
h1 { |
|
|
|
h1 { |
|
|
|
margin-bottom: 20px; |
|
|
|
margin-bottom: 20px; |
|
|
|
font-size: 34px; |
|
|
|
font-size: 34px; |
|
|
@ -330,22 +390,26 @@ export default { |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/ .form { |
|
|
|
/deep/ .form { |
|
|
|
padding: 20px 60px 0; |
|
|
|
padding: 20px 60px 0; |
|
|
|
background-color: rgba(255, 255, 255, .3); |
|
|
|
background-color: rgba(255, 255, 255, .3); |
|
|
|
border-radius: 4px; |
|
|
|
border-radius: 4px; |
|
|
|
box-sizing: border-box; |
|
|
|
box-sizing: border-box; |
|
|
|
border: 4px solid rgba(255, 255, 255, .2); |
|
|
|
border: 4px solid rgba(255, 255, 255, .2); |
|
|
|
|
|
|
|
|
|
|
|
.el-input__inner { |
|
|
|
.el-input__inner { |
|
|
|
height: 50px; |
|
|
|
height: 50px; |
|
|
|
line-height: 50px; |
|
|
|
line-height: 50px; |
|
|
|
border: 1px solid rgba(220, 220, 220, 1); |
|
|
|
border: 1px solid rgba(220, 220, 220, 1); |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-form-item { |
|
|
|
.el-form-item { |
|
|
|
margin-bottom: 25px; |
|
|
|
margin-bottom: 25px; |
|
|
|
} |
|
|
|
} |
|
|
|
.verification{ |
|
|
|
|
|
|
|
|
|
|
|
.verification { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 1px; |
|
|
|
top: 1px; |
|
|
|
right: 1px; |
|
|
|
right: 1px; |
|
|
@ -354,12 +418,14 @@ export default { |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.tab{ |
|
|
|
|
|
|
|
|
|
|
|
.tab { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
align-items: center; |
|
|
|
margin-bottom: 24px; |
|
|
|
margin-bottom: 24px; |
|
|
|
li{ |
|
|
|
|
|
|
|
|
|
|
|
li { |
|
|
|
padding: 18px 5px; |
|
|
|
padding: 18px 5px; |
|
|
|
margin: 0 20px; |
|
|
|
margin: 0 20px; |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
@ -367,23 +433,28 @@ export default { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
border-bottom: 2px solid transparent; |
|
|
|
border-bottom: 2px solid transparent; |
|
|
|
&:last-child{ |
|
|
|
|
|
|
|
|
|
|
|
&:last-child { |
|
|
|
margin-right: 0; |
|
|
|
margin-right: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
&.active{ |
|
|
|
|
|
|
|
|
|
|
|
&.active { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
border-bottom-color: #ccc; |
|
|
|
border-bottom-color: #ccc; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.title{ |
|
|
|
|
|
|
|
|
|
|
|
.title { |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
font-weight: bold; |
|
|
|
font-weight: bold; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login-btn { |
|
|
|
.login-btn { |
|
|
|
text-align: center; |
|
|
|
text-align: center; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.login-btn button { |
|
|
|
.login-btn button { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
height: 48px; |
|
|
|
height: 48px; |
|
|
@ -393,13 +464,55 @@ export default { |
|
|
|
border-radius: 4px; |
|
|
|
border-radius: 4px; |
|
|
|
border: 0; |
|
|
|
border: 0; |
|
|
|
} |
|
|
|
} |
|
|
|
.forget{ |
|
|
|
|
|
|
|
|
|
|
|
.forget { |
|
|
|
margin-bottom: 28px; |
|
|
|
margin-bottom: 28px; |
|
|
|
text-align: right; |
|
|
|
text-align: right; |
|
|
|
color: #999; |
|
|
|
color: #999; |
|
|
|
font-weight:bold; |
|
|
|
font-weight: bold; |
|
|
|
&:hover{ |
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
color: #0092FF; |
|
|
|
color: #0092FF; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/deep/.user-dia { |
|
|
|
|
|
|
|
.tips { |
|
|
|
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
|
|
|
text-align: center; |
|
|
|
|
|
|
|
color: #666; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.users { |
|
|
|
|
|
|
|
li { |
|
|
|
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
justify-content: space-between; |
|
|
|
|
|
|
|
align-items: center; |
|
|
|
|
|
|
|
padding: 0 15px; |
|
|
|
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
|
|
|
line-height: 40px; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
background-color: #ebeef5; |
|
|
|
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&.isEnable { |
|
|
|
|
|
|
|
color: #c0c4cc; |
|
|
|
|
|
|
|
background-color: #f5f7fa; |
|
|
|
|
|
|
|
cursor: not-allowed; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:last-child { |
|
|
|
|
|
|
|
margin-bottom: 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
|
|
|
background-color: #d3e0ff; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i { |
|
|
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |