diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..73c4a95 --- /dev/null +++ b/.env.development @@ -0,0 +1,5 @@ +NODE_ENV='development' +# 请求域名前缀 +VUE_APP_URL='https://swsz.api.js-dyyj.com' +# 打包后输出目录 +VUE_APP_OUTPUTDIR='dist_dev' \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..8808c55 --- /dev/null +++ b/.env.production @@ -0,0 +1,5 @@ +NODE_ENV='production' +# 请求域名前缀 +VUE_APP_URL='https://api.sutenong.com' +# 打包后输出目录 +VUE_APP_OUTPUTDIR='dist' \ No newline at end of file diff --git a/src/libs/axios.js b/src/libs/axios.js index 728d487..d7fc7af 100644 --- a/src/libs/axios.js +++ b/src/libs/axios.js @@ -17,7 +17,7 @@ http.interceptors.request.use((config) => { config.baseURL = process.env.VUE_APP_URL; } - const token = store.state.user.userInfo.token; + const token = store.state.user?.userInfo?.token || ''; config.headers['token'] = token config.headers['Content-Type'] = 'application/json;charset=UTF-8'; @@ -84,7 +84,7 @@ http.interceptors.response.use(response => { }); // 请求方法挂载 -Vue.prototype.get = (params, url, loading = true) => { +Vue.prototype.get = (params, url, loading = false) => { return new Promise((resolve, reject) => { http.get(url, { params, @@ -99,7 +99,7 @@ Vue.prototype.get = (params, url, loading = true) => { }) } -Vue.prototype.post = (data, url, loading = true) => { +Vue.prototype.post = (data, url, loading = false) => { return new Promise((resolve, reject) => { http.post(url, data, { loading // 传递加载状态参数 diff --git a/src/libs/utils.js b/src/libs/utils.js index aa1e801..ae8c394 100644 --- a/src/libs/utils.js +++ b/src/libs/utils.js @@ -75,53 +75,8 @@ export default { return 'https://changshu.js-dyyj.com' + img; } }, - // 跳回小程序 - gotoDetailMini(item) { - console.log(item) - if(item.link_type == 1) { - // 外部小程序 - let data = { - type: 'xcx', - url: item.ext_link - } - uni.navigateTo({ - url: '/subPackages/h5Web/h5Web?data=' + JSON.stringify(data) - }) - return - }else if(item.link_type == 2){ - // 外部H5 - // window.location.href = item.ext_link - window.location.href = 'https://m.cloud.sz-trip.com/MailMerchandiseDetail?type=ticket&platform=changshu&id=' + item.id - return - } - // switch (item.genre){ - // // 景点 - // case 'ticket': - // uni.navigateTo({ - // url: '/subPackages/ticketBooking/detail?id=' + item.id - // }) - // break; - // // 酒店 - // case 'hotel': - // uni.navigateTo({ - // url: '/subPackages/hotelHomestay/detail?id=' + item.id - // }) - // break; - // // 美食 - // case 'food': - // uni.navigateTo({ - // url: '/subPackages/food/foodDetail?id=' + item.id - // }) - // break; - // // 攻略 - // case 'article': - // uni.navigateTo({ - // url: '/subPackages/travelGuide/detail?id=' + item.id - // }) - // break; - // default: - // break; - // } + gotoPath(path) { + this.$router.push(path) } } } diff --git a/src/router/index.js b/src/router/index.js index c44c2da..5d4c31f 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -179,24 +179,24 @@ const router = new Router({ // }, // component: () => import('@/views/OrderDetail.vue') // }, - // { - // path: '/login', - // name: 'Login', - // meta: { - // title: '登录 - 精品商城', - // keepAlive: false - // }, - // component: () => import('@/views/Login.vue') - // }, - // { - // path: '/register', - // name: 'Register', - // meta: { - // title: '注册 - 精品商城', - // keepAlive: false - // }, - // component: () => import('@/views/Register.vue') - // }, + { + path: '/login', + name: 'Login', + meta: { + title: '登录 - 精品商城', + keepAlive: false + }, + component: () => import('@/views/Login.vue') + }, + { + path: '/register', + name: 'Register', + meta: { + title: '注册 - 精品商城', + keepAlive: false + }, + component: () => import('@/views/Register.vue') + }, // { // path: '*', // name: 'NotFound', diff --git a/src/views/Home.vue b/src/views/Home.vue index d0d2430..906682c 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -1,27 +1,27 @@ \ No newline at end of file diff --git a/src/views/Register.vue b/src/views/Register.vue new file mode 100644 index 0000000..6415bf7 --- /dev/null +++ b/src/views/Register.vue @@ -0,0 +1,356 @@ + + + + + \ No newline at end of file