Commit 74c2f858 by 林家欣

联调动态url

parent 276e7eca
// import {
// GET
// } from "./fetch.js"
import {
GET
} from "./fetch.js"
import Vue from "vue";
import VueResource from 'vue-resource'
Vue.use(VueResource);
......@@ -8,13 +8,19 @@ Vue.use(VueResource);
const Prefix2 = process.env.NODE_ENV === 'development' ? '/gs1' : process.env.VUE_APP_API_URL;
/* 公共接口 */
// 首页大轮播图
// 获取验证码
const getCaptcha = (query = {}) => {
return Vue.http.get(`${Prefix2}/office/captcha.jpg?uuid=${query.uuid}`, {
responseType: "blob",
})
}
// 获取url
const homeGetUrl = (params = {}) => {
return GET(`${Prefix2}/office/domain/api/list`, params)
}
import home from "./module/home.js"
import org from "./module/org.js"
import business from "./module/business.js"
......@@ -37,6 +43,7 @@ const api = {
news,
myManage,
getCaptcha,
homeGetUrl,
user,
barcode,
sell,
......
......@@ -10,9 +10,11 @@
</template>
<script>
import TopBanner from './layout/topBanner.vue'
import TopBanner from "./layout/topBanner.vue";
import Header from "./layout/header/index.vue";
import Footer from "./layout/footer.vue"
import Footer from "./layout/footer.vue";
import { mapMutations } from "vuex";
export default {
components: {
TopBanner,
......@@ -26,9 +28,23 @@ export default {
};
},
computed: {},
methods: {},
created() {},
created() {
this.homeGetUrl();
},
mounted() {},
methods: {
...mapMutations({
setUrl: "setUrl",
}),
async homeGetUrl() {
const homeGetUrlRes = await this.$api.homeGetUrl();
const { returnCode, data } = homeGetUrlRes;
if (returnCode === "0") {
console.log(homeGetUrlRes, 'homeGetUrlRes');
this.setUrl(data);
}
},
},
};
</script>
......@@ -1081,6 +1081,7 @@ export default {
async getCustomServiceFromServer() {
const searchGlnRes = await this.$api.home.customService();
const { returnCode, data } = searchGlnRes;
if (returnCode === "0") {
localStorage.setItem("gs-custom-service", JSON.stringify(data));
......
export const SET_MATCHE = 'setMatche';
export const SET_URL = 'setUrl';
......@@ -10,6 +10,7 @@ Vue.use(Vuex)
import {
SET_MATCHE,
SET_URL,
} from './mutation-types';
const state = {
......@@ -27,6 +28,10 @@ const mutations = {
localStorage.setItem('matche', JSON.stringify(data));
state.matche = data;
},
[SET_URL](state, data) {
console.log(data, 'data');
// state.urls.gs1cnOne = data[0];
},
};
export default new Vuex.Store({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment