cmy 9 miesięcy temu
rodzic
commit
06ca38d1b7
2 zmienionych plików z 10 dodań i 3 usunięć
  1. 8 2
      pages/apply/choose.vue
  2. 2 1
      store/index.js

+ 8 - 2
pages/apply/choose.vue

@@ -28,6 +28,9 @@
 import { shareLoad } from '../../utils/wxAuthorized.js'
 import { getIndex } from '../../api/apply.js'
 import { getUserInfo } from '../../api/login.js'
+import {
+		mapState,
+	} from 'vuex';
 export default {
 	data() {
 		return {
@@ -35,6 +38,9 @@ export default {
 			img: require('@/static/img/logo.png'),
 		}
 	},
+	computed: {
+		...mapState(['baseURL'])
+	},
 	mounted() {
 		this.getContent()
 	},
@@ -61,10 +67,10 @@ export default {
 		share() {
 			const pages = getCurrentPages()
 			const path = pages[pages.length - 1].route
-			const baseURL = this.$store.state.baseURL
+			const baseURL = this.baseURL;
 			const data = {
 				link: window.location.href, // 分享链接
-				imgUrl: 'http://vote.deepbytop.com/index/static/img/logo.f387ae76.png',
+				imgUrl: `${baseURL}/index/static/img/logo.f387ae76.png`,
 				desc: '母婴健康专委会会员申请表',
 				title: '母婴健康专委会会员申请表',
 				fail:function (e) {

+ 2 - 1
store/index.js

@@ -6,7 +6,8 @@ Vue.use(Vuex)
 const store = new Vuex.Store({
 	state: {
 		// baseURL:"http://yrh.liuniu946.com",//'http://eb.shuibo.net',//请求地址配置 
-		baseURL:'https://vote.myjie.cn',//请求地址配置 
+		// baseURL:'https://vote.myjie.cn',//请求地址配置 
+		baseURL:  window.location.protocol + "//" + window.location.host,
 		urlFile:'/index',//项目部署所在文件夹
 		loginInterceptor:false,//是否打开强制登录
 		// #ifdef H5 || MP-WEIXIN