lex 1 éve
szülő
commit
df499d367d

+ 25 - 5
src/student/down-load/download.tsx

@@ -2,6 +2,7 @@ import { browser } from '@/helpers/utils'
 import { Button, Toast } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
+import request from '@/helpers/request'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -15,15 +16,34 @@ export default defineComponent({
     const query = this.$route.query
     return {
       type: query.type || 'student',
+      androidUrl: '',
       wxStatus: false
     }
   },
-  mounted() {
+  async mounted() {
+    let platform = 'android-student'
     if (this.type === 'student') {
+      platform = 'android-student'
       document.title = '酷乐秀下载'
     } else if (this.type === 'teacher') {
+      platform = 'android-teacher'
       document.title = '酷乐秀学院下载'
     }
+
+    try {
+      const { data } = await request.get(
+        '/api-student/open/appVersionInfo/queryLatestByPlatform',
+        {
+          params: {
+            platform,
+            status: 'history'
+          }
+        }
+      )
+      this.androidUrl = data.downloadUrl
+    } catch {
+      //
+    }
   },
   methods: {
     downLoadApp() {
@@ -47,18 +67,18 @@ export default defineComponent({
       if (location.origin.indexOf('online.colexiu.com') > -1) {
         if (this.type === 'student') {
           urlIos = 'https://itunes.apple.com/cn/app/id1626971695?mt=8'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
+          urlAndroid = this.androidUrl // 'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
         } else if (this.type === 'teacher') {
           urlIos = 'https://itunes.apple.com/cn/app/id1626971149?mt=8'
-          urlAndroid = 'https://oss.dayaedu.com/appstore/clx-teacher-domain.apk'
+          urlAndroid = this.androidUrl // 'https://oss.dayaedu.com/appstore/clx-teacher-domain.apk'
         }
       } else {
         if (this.type === 'student') {
           urlIos = 'https://www.pgyer.com/powy'
-          urlAndroid = 'https://www.pgyer.com/70e7'
+          urlAndroid = this.androidUrl // 'https://www.pgyer.com/70e7'
         } else {
           urlIos = 'https://www.pgyer.com/iO0m'
-          urlAndroid = 'https://www.pgyer.com/N2U3'
+          urlAndroid = this.androidUrl // 'https://www.pgyer.com/N2U3'
         }
       }
 

+ 19 - 4
src/student/down-load/transfer.tsx

@@ -3,6 +3,7 @@ import { url } from 'inspector'
 import { Button, Toast } from 'vant'
 import { defineComponent } from 'vue'
 import styles from './index.module.less'
+import request from '@/helpers/request'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `./images/${fileName}`
@@ -14,10 +15,25 @@ export default defineComponent({
   name: 'transfer',
   data() {
     return {
-      wxStatus: false
+      wxStatus: false,
+      androidUrl: ''
     }
   },
-  mounted() {
+  async mounted() {
+    try {
+      const { data } = await request.get(
+        '/api-student/open/appVersionInfo/queryLatestByPlatform',
+        {
+          params: {
+            platform: 'android-student',
+            status: 'history'
+          }
+        }
+      )
+      this.androidUrl = data.downloadUrl
+    } catch {
+      //
+    }
     const { origin, pathname } = location
     let str = origin + pathname + '#/'
     const params = this.$route.query
@@ -65,8 +81,7 @@ export default defineComponent({
         window.location.href =
           'https://itunes.apple.com/cn/app/id1626971695?mt=8'
       } else if (/(Android)/i.test(navigator.userAgent)) {
-        window.location.href =
-          'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
+        window.location.href = this.androidUrl // 'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
       } else {
         this.$toast('请用手机或移动设备打开')
       }

+ 20 - 3
src/student/invite-teacher/invite-success/index.tsx

@@ -5,12 +5,30 @@ import { Button } from 'vant'
 import { browser } from '@/helpers/utils'
 
 import wxBg from '../../down-load/images/wx_bg.png'
+import request from '@/helpers/request'
 
 export default defineComponent({
   name: 'inviteSuccess',
   data() {
     return {
-      wxStatus: false
+      wxStatus: false,
+      androidUrl: ''
+    }
+  },
+  async mounted() {
+    try {
+      const { data } = await request.get(
+        '/api-student/open/appVersionInfo/queryLatestByPlatform',
+        {
+          params: {
+            platform: 'android-student',
+            status: 'history'
+          }
+        }
+      )
+      this.androidUrl = data.downloadUrl
+    } catch {
+      //
     }
   },
   methods: {
@@ -23,8 +41,7 @@ export default defineComponent({
         window.location.href =
           'https://itunes.apple.com/cn/app/id1626971695?mt=8'
       } else if (/(Android)/i.test(navigator.userAgent)) {
-        window.location.href =
-          'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
+        window.location.href = this.androidUrl //  'https://oss.dayaedu.com/appstore/clx-student-domain.apk'
       } else {
         this.$toast('请用手机或移动设备打开')
       }

+ 1 - 1
vite.config.ts

@@ -12,7 +12,7 @@ function resolve(dir: string) {
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
 // const proxyUrl = 'https://online.colexiu.com/';
-const proxyUrl = 'https://test.colexiu.com/'
+const proxyUrl = 'https://dev.colexiu.com/'
 // const proxyUrl = 'http://192.168.3.143:8000/'
 export default defineConfig({
   base: './',