进一步整合js工具

This commit is contained in:
aixianling
2022-03-03 16:18:54 +08:00
parent c521c38af3
commit d546d47f3d

View File

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