| | |
| | | import { useLoginStore } from '@/stores/login.js' |
| | | import { storeToRefs } from 'pinia'; |
| | | import { isWeixin } from '@/utils/UA.js' |
| | | import cityItems from '@/assets/json/cityItems.json' |
| | | export default { |
| | | setup() { |
| | | const { lastRouteInfo } = storeToRefs(useLoginStore()) |
| | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | tokenUtils.clearTokens() |
| | | this.loginType = isWeixin ? 'weixin' : 'mobilePhone' |
| | | if (isWeixin) { |
| | |
| | | } |
| | | }, |
| | | login() { |
| | | const data = { |
| | | let data = { |
| | | mobile: this.form.mobile, |
| | | code: this.form.code, |
| | | } |
| | |
| | | const resData = res.data.data |
| | | tokenUtils.setTokens(resData.accessToken, resData.refreshToken) |
| | | this.$message.success('登录成功') |
| | | const path = localStorage.getItem('verify_url') |
| | | const path = localStorage.getItem('_enterUrl') |
| | | if (path) { |
| | | this.$router.replace(path) |
| | | } |