Explorar o código

Merge branch 'newVersion' into dev

lex %!s(int64=2) %!d(string=hai) anos
pai
achega
93d26cc4cf

+ 10 - 1
src/views/login/components/register-success/index.tsx

@@ -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() {

+ 1 - 3
src/views/login/components/teacher-auth/index.tsx

@@ -17,9 +17,7 @@ export default defineComponent({
     onDetail(type = 'teacher' as 'teacher' | 'music') {
       this.onClose()
       if (type === 'teacher') {
-        window.location.href =
-          location.origin + location.pathname + '#/teacherAuth'
-        // this.$router.push('/teacherAuth')
+        this.$router.push('/teacherAuth')
       } else if (type === 'music') {
         this.$router.push('/musicAuth')
       }