| | |
| | | </template> |
| | | <script> |
| | | import { useSessionStore } from '@/stores/session.js' |
| | | import { storeToRefs } from 'pinia'; |
| | | import { storeToRefs } from 'pinia' |
| | | export default { |
| | | setup() { |
| | | const { setUserInfo } = useSessionStore() |
| | |
| | | data() { |
| | | return {} |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | created() { |
| | | if (this.$route.path == '/h5/verify' && this.$route.query.appId) { |
| | | localStorage.setItem('verify_url', this.$route.fullPath) |
| | | const path = this.$route.path |
| | | const regionCode = this.$route.query.regionCode //未使用 |
| | | const fullPath = this.$route.fullPath |
| | | let personType = null |
| | | if (path == '/h5/addrVer') { //0==工作人员 2==考点核验员 |
| | | personType = '2' |
| | | } else if (path == '/h5/staffSignIn') { |
| | | personType = '0' |
| | | } |
| | | localStorage.setItem('_personType', personType) |
| | | localStorage.setItem('_regionCode', regionCode) |
| | | localStorage.setItem('_enterUrl', fullPath) |
| | | this.getUserInfo() |
| | | }, |
| | | methods: { |
| | |
| | | this.$axios.get('/system/auth/staff/profile').then(res => { |
| | | if (res.data.code == 0) { |
| | | this.setUserInfo(res.data.data || {}) |
| | | } else if (res.data.code != 401) { |
| | | const tip = res.data.msg || '获取账号信息异常' |
| | | this.$message.error(tip) |
| | | this.$router.replace({ path: '/h5/noTask', query: { tip } }) |
| | | } |
| | | }).catch(() => { |
| | | const tip = '获取账号信息异常' |
| | | this.$router.replace({ path: '/h5/noTask', query: { tip }}) |
| | | this.$message.error(tip) |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | </script> |