Browse Source

fix:修改域名、pc默认头像

yangfeng 4 years ago
parent
commit
ef91a334fd

+ 1 - 1
jypoints-mobile/.env.production

@@ -1,4 +1,4 @@
 NODE_ENV=production
 VUE_APP_BASE_API = ''
 BASE_URL = '/page_points_app'
-VUE_APP_LOG_URL = 'https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='
+VUE_APP_LOG_URL = 'https://www.jianyu360.com/jyLogs/actionInfo?logAction='

+ 4 - 0
jypoints-mobile/.env.test

@@ -0,0 +1,4 @@
+NODE_ENV=production
+VUE_APP_BASE_API = ''
+BASE_URL = '/page_points_app'
+VUE_APP_LOG_URL = 'https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='

+ 1 - 0
jypoints-mobile/package.json

@@ -5,6 +5,7 @@
   "scripts": {
     "serve": "vue-cli-service serve",
     "build": "vue-cli-service build --mode production",
+    "build:test": "vue-cli-service build --mode test",
     "lint": "vue-cli-service lint --fix",
     "analyzer": "use_analyzer=true vue-cli-service build --mode production",
     "analyze": "cross-env use_analyzer=true vue-cli-service build --mode production"

+ 26 - 7
jypoints-mobile/src/views/404.vue

@@ -20,21 +20,40 @@ import empty from '@/components/common/Empty.vue'
 })
 
 export default class Page404 extends Vue {
-  created () {
-    const route = this.$route
-    const redirectedFrom = route.redirectedFrom
+  beforeRouteEnter (to, from, next) {
+    console.log(to, from)
+    const isWeiXinBrowser = navigator.userAgent.toLowerCase().indexOf('micromessenger') !== -1
+    const redirectedFrom = to.redirectedFrom
+    console.log(redirectedFrom, isWeiXinBrowser)
     if (redirectedFrom) {
-      console.log('路由:%c %s %c未找到', 'color: red', redirectedFrom, 'color: #000')
-      if (this.$env.isWeiXinBrowser) {
+      if (isWeiXinBrowser) {
         if (redirectedFrom.indexOf('integralDetail') > -1) {
-          window.location.href = window.location.origin + redirectedFrom
+          location.replace(window.location.origin + redirectedFrom)
         }
       } else {
         if (redirectedFrom.indexOf('tointegralDetail') > -1) {
-          window.location.href = window.location.origin + redirectedFrom
+          location.replace(window.location.origin + redirectedFrom)
         }
       }
     }
+    next()
+  }
+
+  created () {
+    // const route = this.$route
+    // const redirectedFrom = route.redirectedFrom
+    // if (redirectedFrom) {
+    //   console.log('路由:%c %s %c未找到', 'color: red', redirectedFrom, 'color: #000')
+    //   if (this.$env.isWeiXinBrowser) {
+    //     if (redirectedFrom.indexOf('integralDetail') > -1) {
+    //       location.replace(window.location.origin + redirectedFrom)
+    //     }
+    //   } else {
+    //     if (redirectedFrom.indexOf('tointegralDetail') > -1) {
+    //       location.replace(window.location.origin + redirectedFrom)
+    //     }
+    //   }
+    // }
   }
 }
 </script>

+ 1 - 1
jypoints-pc/.env.production

@@ -2,4 +2,4 @@ NODE_ENV=production
 VUE_APP_BASE_API=''
 VUE_APP_BASE_URL='/swordfish/integral/index'
 VUE_APP_BASE_PUBLIC='/page_points/'
-VUE_APP_LOG_URL = 'https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='
+VUE_APP_LOG_URL = 'https://www.jianyu360.com/jyLogs/actionInfo?logAction='

+ 5 - 0
jypoints-pc/.env.test

@@ -0,0 +1,5 @@
+NODE_ENV=production
+VUE_APP_BASE_API=''
+VUE_APP_BASE_URL='/swordfish/integral/index'
+VUE_APP_BASE_PUBLIC='/page_points/'
+VUE_APP_LOG_URL = 'https://web2-jytest.jydev.jianyu360.com/jyLogs/actionInfo?logAction='

+ 1 - 0
jypoints-pc/package.json

@@ -5,6 +5,7 @@
   "scripts": {
     "serve": "vue-cli-service serve --port 8080",
     "serve:alone": "vue-cli-service serve --mode alone",
+    "build:test": "vue-cli-service build --mode test",
     "build": "vue-cli-service build"
   },
   "dependencies": {

+ 1 - 1
jypoints-pc/src/views/Home.vue

@@ -169,7 +169,7 @@ export default {
       getUserInfo().then(res => {
         if (res.data.error_code == 0 && res.data.data) {
           this.userInfo.nickName = res.data.data.nickname;
-          this.userInfo.imgUrl = res.data.data.headimageurl;
+          this.userInfo.imgUrl = res.data.data.headimageurl ? res.data.data.headimageurl : 'https://www.jianyu360.com/images/auto.png';
         }
       }).catch(err => {
         console.log(err)