进一步整合js工具
This commit is contained in:
@@ -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,13 +45,12 @@ export default {
|
||||
}, {withoutToken: true}).then(d => {
|
||||
if (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);
|
||||
});
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -59,6 +60,7 @@ export default {
|
||||
.confirm-button {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.confirm-button::after {
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user