shish 4 лет назад
Родитель
Сommit
6fa2e55254
2 измененных файлов с 8 добавлено и 5 удалено
  1. 4 2
      ghsApp/src/mixins/autoUpdate.js
  2. 4 3
      hdApp/src/mixins/autoUpdate.js

+ 4 - 2
ghsApp/src/mixins/autoUpdate.js

@@ -1,5 +1,5 @@
 import { getApkVersion } from '@/api/auth'
-import { APIHOST } from '@/config'
+import { IMGHOST } from '@/config'
 export default {
 	data() {
 		return {
@@ -24,6 +24,7 @@ export default {
 	methods: {
         androidCheckUpdate(){
             getApkVersion().then(res=>{
+                console.log(res)
                 if(res.code == 1){
                     let version = res.data.version
                     let mustUpdate = res.data.mustUpdate
@@ -47,7 +48,8 @@ export default {
         },
         install(version){
             uni.showToast({ title: '后台下载中...', mask: false, duration: 1200,icon:"none"})
-            var dtask = plus.downloader.createDownload( APIHOST+'/apk/'+version+'.apk', {}, function ( d, status ) {
+            console.log(IMGHOST+'/apk/ghs/'+version+'.apk')
+            var dtask = plus.downloader.createDownload( IMGHOST+'/apk/ghs/'+version+'.apk', {}, function ( d, status ) {
                 // 下载完成
                 if ( status == 200 ) {
                     plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename),{},{},function(error){

+ 4 - 3
hdApp/src/mixins/autoUpdate.js

@@ -1,5 +1,5 @@
 import { getApkVersion } from '@/api/auth'
-import { APIHOST } from '@/config'
+import { IMGHOST } from '@/config'
 export default {
 	data() {
 		return {
@@ -24,6 +24,7 @@ export default {
 	methods: {
         androidCheckUpdate(){
             getApkVersion().then(res=>{
+                console.log(res)
                 if(res.code == 1){
                     let version = res.data.version
                     let mustUpdate = res.data.mustUpdate
@@ -47,9 +48,9 @@ export default {
             })            
         },
         install(version){
-            console.log(APIHOST+'/apk/'+version+'.apk')
+            console.log(IMGHOST+'/apk/hd/'+version+'.apk')
             uni.showToast({ title: '后台下载中...', mask: false, duration: 1200,icon:"none"})
-            var dtask = plus.downloader.createDownload( APIHOST+'/apk/'+version+'.apk', {}, function ( d, status ) {  
+            var dtask = plus.downloader.createDownload( IMGHOST+'/apk/hd/'+version+'.apk', {}, function ( d, status ) {  
                 // 下载完成  
                 if ( status == 200 ) {   
                     plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename),{},{},function(error){