|
@@ -4,6 +4,7 @@ import teacherDownLoad from '@/common/images/teacher_download.png'
|
|
|
import styles from '../../index.module.less'
|
|
|
import { ElButton } from 'element-plus'
|
|
|
import { getUserType } from '@/helpers/utils'
|
|
|
+import { getUserInfo, state } from '@/state'
|
|
|
export const getAssetsHomeFile = (fileName: string) => {
|
|
|
const path = `../../images/${fileName}`
|
|
|
const modules = import.meta.globEager('../../images/*')
|
|
@@ -26,7 +27,15 @@ export default defineComponent({
|
|
|
registerType: 'student' as 'teacher' | 'student'
|
|
|
}
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ async mounted() {
|
|
|
+ try {
|
|
|
+ if (state.user.data?.userId) {
|
|
|
+ // 获取用户信息
|
|
|
+ await getUserInfo()
|
|
|
+ }
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
this.registerType = getUserType() === 'STUDENT' ? 'student' : 'teacher'
|
|
|
},
|
|
|
render() {
|