|
@@ -38,7 +38,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="submit-line">
|
|
|
- <el-button @click="check()">登录</el-button>
|
|
|
+ <el-button @click="postLoginData()">登录</el-button>
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</div>
|
|
@@ -213,7 +213,7 @@ export default {
|
|
|
value: '0',
|
|
|
input: '',
|
|
|
logData: {
|
|
|
- type: 'sms',
|
|
|
+ type: '',
|
|
|
area: 86,
|
|
|
mobile: '',
|
|
|
email: '',
|
|
@@ -269,25 +269,43 @@ export default {
|
|
|
this.state = 'find'
|
|
|
}
|
|
|
},
|
|
|
- check:function(){
|
|
|
- let pNum = this.logData.mobile
|
|
|
- if(pNum==''){
|
|
|
- alert('请输入您的手机号')
|
|
|
- }else if(pNum ){
|
|
|
|
|
|
+ postLoginData: function () {
|
|
|
+ if(this.isPhone){
|
|
|
+ this.logData.type = 'sms'
|
|
|
+ this.axios.post('https://dev407.33.cn/api/broker/login', qs.stringify(this.logData)).then((res) => {
|
|
|
+ if(res.data.error == 'OK'){
|
|
|
+ localStorage.setItem('userInfo',JSON.stringify(res.data.data))
|
|
|
+ this.usr.username = res.data.data.username
|
|
|
+ this.$store.dispatch('login')
|
|
|
+ console.log(this.$store.state.loginedUser.username)
|
|
|
+ }else{
|
|
|
+ this.notify(res.data.message,'warning')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }else if(this.isEmail){
|
|
|
+ this.logData.type = 'email'
|
|
|
+ this.axios.post('https://dev407.33.cn/api/broker/login', qs.stringify(this.logData)).then((res) => {
|
|
|
+ if(res.data.error == 'OK'){
|
|
|
+ localStorage.setItem('userInfo',JSON.stringify(res.data.data))
|
|
|
+ this.usr.username = res.data.data.username
|
|
|
+ this.$store.dispatch('login')
|
|
|
+ console.log(this.$store.state.loginedUser.username)
|
|
|
+ }else{
|
|
|
+ this.notify(res.data.message,'warning')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
},
|
|
|
- postLoginData: function () {
|
|
|
- this.axios.post('https://dev407.33.cn/api/broker/login', qs.stringify(this.logData)).then((res) => {
|
|
|
- localStorage.setItem('userInfo',JSON.stringify(res.data.data))
|
|
|
- this.usr.username = res.data.data.username
|
|
|
- this.$store.dispatch('login')
|
|
|
- console.log(this.$store.state.loginedUser.username)
|
|
|
-
|
|
|
+ notify(mes,type) {
|
|
|
+ this.$notify({
|
|
|
+ title: '提示',
|
|
|
+ message: mes,
|
|
|
+ type: type
|
|
|
})
|
|
|
},
|
|
|
- postMsg: function () {
|
|
|
+ postMsg : function () {
|
|
|
this.axios.post('https://dev407.33.cn/api/send/newsms', qs.stringify(this.postMsgData)).then((response) => {
|
|
|
console.log(response.data)
|
|
|
})
|