进一步整合js工具
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import tools from '../utils/util'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AiLogin',
|
name: 'AiLogin',
|
||||||
data() {
|
data() {
|
||||||
@@ -21,11 +23,11 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
show() {
|
show() {
|
||||||
this.$getUserProfile().then(data => {
|
tools.$getUserProfile().then(data => {
|
||||||
this.userData = data.userInfo;
|
this.userData = data.userInfo;
|
||||||
this.userPhoneShow = true;
|
this.userPhoneShow = true;
|
||||||
})
|
})
|
||||||
this.$getLoginCode().then(res => {
|
tools.$getLoginCode().then(res => {
|
||||||
this.code = res.code;
|
this.code = res.code;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -35,7 +37,7 @@ export default {
|
|||||||
getPhoneNumber(arg) {
|
getPhoneNumber(arg) {
|
||||||
const {encryptedData, errMsg, iv} = arg.detail
|
const {encryptedData, errMsg, iv} = arg.detail
|
||||||
if (errMsg == 'getPhoneNumber:ok') {
|
if (errMsg == 'getPhoneNumber:ok') {
|
||||||
this.$getLoginCode().then(() => {
|
tools.$getLoginCode().then(() => {
|
||||||
// let body = {...this.userData, encryptedData, iv, code: res.code}
|
// let body = {...this.userData, encryptedData, iv, code: res.code}
|
||||||
this.$instance.post(`/app/appwechatuser/getWechatUserPhone`, {
|
this.$instance.post(`/app/appwechatuser/getWechatUserPhone`, {
|
||||||
encryptedData, iv,
|
encryptedData, iv,
|
||||||
@@ -43,23 +45,23 @@ export default {
|
|||||||
}, {withoutToken: true}).then(d => {
|
}, {withoutToken: true}).then(d => {
|
||||||
if (d.data) {
|
if (d.data) {
|
||||||
let data = {...this.userData, phone: d.data};
|
let data = {...this.userData, phone: d.data};
|
||||||
this.$autoLogin(data).then(res=>{
|
this.$autoLogin(data, this.$store).then(res => {
|
||||||
this.$emit("success",res);
|
this.$emit("success", res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.confirm-button{
|
.confirm-button {
|
||||||
background-color: #fff!important;
|
background-color: #fff !important;
|
||||||
}
|
}
|
||||||
.confirm-button::after{
|
|
||||||
border: none!important;
|
.confirm-button::after {
|
||||||
|
border: none !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user