Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gs1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴迪
gs1
Commits
7057b6d3
Commit
7057b6d3
authored
Nov 26, 2021
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改发布后接口配置
parent
f62c5d85
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
43 additions
and
25 deletions
+43
-25
.env.development
.env.development
+3
-0
.env.production
.env.production
+4
-1
nginx.conf
nginx.conf
+1
-1
App.vue
src/App.vue
+6
-2
api.js
src/axios/api.js
+10
-5
fetch.js
src/axios/fetch.js
+3
-1
constant.js
src/config/constant.js
+0
-0
utils.js
src/utils/utils.js
+9
-9
index.vue
src/views/Home/index.vue
+2
-1
external.vue
src/views/Search/external.vue
+5
-5
No files found.
.env.development
View file @
7057b6d3
VUE_APP_CURRENTMODE = "development"
VUE_APP_CURRENTMODE = "development"
VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_HOST_URL = "http://81.68.189.225:9091"
VUE_APP_API_URL = "/"
VUE_APP_GDS_URL = "/gds"
VUE_APP_LOG = true
VUE_APP_LOG = true
\ No newline at end of file
.env.production
View file @
7057b6d3
VUE_APP_CURRENTMODE = "production"
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
VUE_APP_LOG = false
\ No newline at end of file
nginx.conf
View file @
7057b6d3
...
@@ -12,7 +12,7 @@ gzip_vary on;
...
@@ -12,7 +12,7 @@ gzip_vary on;
gzip_disable
"MSIE
[1-6]
\
."
;
gzip_disable
"MSIE
[1-6]
\
."
;
server
{
server
{
listen
8088
;
listen
9091
;
server_name
81
.68.189.225
;
server_name
81
.68.189.225
;
location
/
{
location
/
{
root
/usr/share/nginx/html
;
root
/usr/share/nginx/html
;
...
...
src/App.vue
View file @
7057b6d3
...
@@ -5,11 +5,15 @@
...
@@ -5,11 +5,15 @@
</
template
>
</
template
>
<
script
>
<
script
>
export
default
{
created
()
{
console
.
log
(
process
.
env
,
'process.env'
);
},
};
</
script
>
</
script
>
<
style
>
<
style
>
.container-fluid
{
.container-fluid
{
padding
:
0
!important
;
padding
:
0
!important
;
}
}
</
style
>
</
style
>
src/axios/api.js
View file @
7057b6d3
import
{
// import {
GET
// GET
}
from
"./fetch.js"
// } from "./fetch.js"
import
Vue
from
"vue"
;
import
VueResource
from
'vue-resource'
Vue
.
use
(
VueResource
);
const
Prefix
=
process
.
env
.
NODE_ENV
===
'development'
?
'/gs1'
:
''
;
const
Prefix
2
=
process
.
env
.
NODE_ENV
===
'development'
?
'/gs1'
:
process
.
env
.
VUE_APP_API_URL
;
/* 公共接口 */
/* 公共接口 */
// 首页大轮播图
// 首页大轮播图
const
getCaptcha
=
(
query
=
{})
=>
{
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"
import
home
from
"./module/home.js"
...
...
src/axios/fetch.js
View file @
7057b6d3
...
@@ -18,7 +18,9 @@ import {
...
@@ -18,7 +18,9 @@ import {
getToken
getToken
}
from
"@/utils/cookie.js"
}
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
)
{
function
fetch
(
options
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
const
instance
=
axios
.
create
({
const
instance
=
axios
.
create
({
...
...
src/config/constant.js
View file @
7057b6d3
This diff is collapsed.
Click to expand it.
src/utils/utils.js
View file @
7057b6d3
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
export
function
throttle
(
fn
,
interval
)
{
export
function
throttle
(
fn
,
interval
)
{
let
delay
=
interval
||
1500
let
delay
=
interval
||
1500
let
previous
=
0
let
previous
=
0
return
function
()
{
return
function
()
{
let
now
=
Date
.
now
()
let
now
=
Date
.
now
()
let
that
=
this
let
that
=
this
let
args
=
arguments
let
args
=
arguments
...
@@ -17,11 +17,11 @@ export function throttle(fn, interval) {
...
@@ -17,11 +17,11 @@ export function throttle(fn, interval) {
export
function
debounce
(
fn
,
interval
)
{
export
function
debounce
(
fn
,
interval
)
{
let
delay
=
interval
||
1500
let
delay
=
interval
||
1500
let
timer
=
null
let
timer
=
null
return
function
()
{
return
function
()
{
let
that
=
this
let
that
=
this
let
args
=
arguments
let
args
=
arguments
timer
&&
clearTimeout
(
timer
)
timer
&&
clearTimeout
(
timer
)
timer
=
setTimeout
(
function
()
{
timer
=
setTimeout
(
function
()
{
fn
.
apply
(
that
,
args
)
fn
.
apply
(
that
,
args
)
},
delay
)
},
delay
)
}
}
...
@@ -47,14 +47,14 @@ export const groupList = (list, length) => {
...
@@ -47,14 +47,14 @@ export const groupList = (list, length) => {
pages
[
page
].
push
(
item
);
pages
[
page
].
push
(
item
);
});
});
return
pages
;
return
pages
;
};
};
/**
/**
* 获取uuid
* 获取uuid
*/
*/
export
const
getUUID
=
()
=>
{
export
const
getUUID
=
()
=>
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
c
=>
{
return
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
.
replace
(
/
[
xy
]
/g
,
c
=>
{
return
(
c
===
'x'
?
(
Math
.
random
()
*
16
|
0
)
:
(
'r&0x3'
|
'0x8'
)).
toString
(
16
)
return
(
c
===
'x'
?
(
Math
.
random
()
*
16
|
0
)
:
(
'r&0x3'
|
'0x8'
)).
toString
(
16
)
})
})
}
}
\ No newline at end of file
\ No newline at end of file
src/views/Home/index.vue
View file @
7057b6d3
...
@@ -1009,7 +1009,8 @@ export default {
...
@@ -1009,7 +1009,8 @@ export default {
},
},
// 商品全球身份证
// 商品全球身份证
async
homeNewGtin
()
{
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
.
murl
=
`http://data-studio.gds.org.cn/
${
res
.
body
.
murl
}
`
;
res
.
body
.
surl
=
`http://data-studio.gds.org.cn/
${
res
.
body
.
surl
}
`
;
res
.
body
.
surl
=
`http://data-studio.gds.org.cn/
${
res
.
body
.
surl
}
`
;
this
.
spqqsfz
=
res
.
body
;
this
.
spqqsfz
=
res
.
body
;
...
...
src/views/Search/external.vue
View file @
7057b6d3
...
@@ -165,11 +165,11 @@ export default {
...
@@ -165,11 +165,11 @@ export default {
// 获取验证码
// 获取验证码
getCaptcha
()
{
getCaptcha
()
{
this
.
uuid
=
getUUID
();
this
.
uuid
=
getUUID
();
this
.
$http
const
query
=
{
.
get
(
`/gs1/office/captcha.jpg?uuid=
${
this
.
uuid
}
`
,
{
uuid
:
this
.
uuid
,
responseType
:
"blob"
,
};
})
this
.
$api
.
getCaptcha
(
query
).
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
res
,
'res'
);
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
});
});
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment