Commit 7057b6d3 by 林家欣

fix: 修改发布后接口配置

parent f62c5d85
VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/"
VUE_APP_GDS_URL = "/gds"
VUE_APP_LOG = true
\ No newline at end of file
VUE_APP_CURRENTMODE = "production"
VUE_APP_HOST_URL = "http://192.168.0.47:8090"
VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "http://81.68.189.225:9091"
VUE_APP_GDS_URL = "http://data-studio.gds.org.cn"
VUE_APP_LOG = false
\ No newline at end of file
......@@ -12,7 +12,7 @@ gzip_vary on;
gzip_disable "MSIE [1-6]\.";
server {
listen 8088;
listen 9091;
server_name 81.68.189.225;
location / {
root /usr/share/nginx/html;
......
......@@ -5,11 +5,15 @@
</template>
<script>
export default {
created() {
console.log(process.env, 'process.env');
},
};
</script>
<style>
.container-fluid{
.container-fluid {
padding: 0 !important;
}
</style>
import {
GET
} from "./fetch.js"
// import {
// GET
// } from "./fetch.js"
import Vue from "vue";
import VueResource from 'vue-resource'
Vue.use(VueResource);
const Prefix = process.env.NODE_ENV === 'development' ? '/gs1' : '';
const Prefix2 = process.env.NODE_ENV === 'development' ? '/gs1' : process.env.VUE_APP_API_URL;
/* 公共接口 */
// 首页大轮播图
const getCaptcha = (query = {}) => {
return GET(`${Prefix}/office/captcha.jpg`, query)
return Vue.http.get(`${Prefix2}/office/captcha.jpg?uuid=${query.uuid}`, {
responseType: "blob",
})
}
import home from "./module/home.js"
......
......@@ -18,7 +18,9 @@ import {
getToken
} from "@/utils/cookie.js"
const baseUrl = process.env.BASE_URL
const baseUrl = process.env.VUE_APP_API_URL;
console.log(process.env, baseUrl, 'baseUrl');
function fetch(options) {
return new Promise((resolve, reject) => {
const instance = axios.create({
......
......@@ -2,7 +2,7 @@
export function throttle(fn, interval) {
let delay = interval || 1500
let previous = 0
return function() {
return function () {
let now = Date.now()
let that = this
let args = arguments
......@@ -17,11 +17,11 @@ export function throttle(fn, interval) {
export function debounce(fn, interval) {
let delay = interval || 1500
let timer = null
return function() {
return function () {
let that = this
let args = arguments
timer && clearTimeout(timer)
timer = setTimeout(function() {
timer = setTimeout(function () {
fn.apply(that, args)
}, delay)
}
......@@ -47,14 +47,14 @@ export const groupList = (list, length) => {
pages[page].push(item);
});
return pages;
};
};
/**
* 获取uuid
*/
/**
* 获取uuid
*/
export const getUUID = () => {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
})
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -1009,7 +1009,8 @@ export default {
},
// 商品全球身份证
async homeNewGtin() {
this.$http.get("/gds/Data/NewGtin").then((res) => {
console.log(process.env, 'process.env');
this.$http.get(`${process.env.VUE_APP_GDS_URL}/Data/NewGtin`).then((res) => {
res.body.murl = `http://data-studio.gds.org.cn/${res.body.murl}`;
res.body.surl = `http://data-studio.gds.org.cn/${res.body.surl}`;
this.spqqsfz = res.body;
......
......@@ -165,11 +165,11 @@ export default {
// 获取验证码
getCaptcha() {
this.uuid = getUUID();
this.$http
.get(`/gs1/office/captcha.jpg?uuid=${this.uuid}`, {
responseType: "blob",
})
.then((res) => {
const query = {
uuid: this.uuid,
};
this.$api.getCaptcha(query).then((res) => {
console.log(res, 'res');
this.captchaPath = window.URL.createObjectURL(res.body);
});
},
......
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