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
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
66 deletions
+84
-66
.env.development
.env.development
+3
-0
.env.production
.env.production
+4
-1
nginx.conf
nginx.conf
+1
-1
App.vue
src/App.vue
+10
-6
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
+44
-44
index.vue
src/views/Home/index.vue
+2
-1
external.vue
src/views/Search/external.vue
+7
-7
No files found.
.env.development
View file @
7057b6d3
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
.env.production
View file @
7057b6d3
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
nginx.conf
View file @
7057b6d3
...
...
@@ -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
;
...
...
src/App.vue
View file @
7057b6d3
<
template
>
<div
id=
"app"
>
<router-view></router-view>
</div>
<div
id=
"app"
>
<router-view></router-view>
</div>
</
template
>
<
script
>
export
default
{
created
()
{
console
.
log
(
process
.
env
,
'process.env'
);
},
};
</
script
>
<
style
>
.container-fluid
{
padding
:
0
!important
;
.container-fluid
{
padding
:
0
!important
;
}
</
style
>
src/axios/api.js
View file @
7057b6d3
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
Prefix
2
=
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"
...
...
src/axios/fetch.js
View file @
7057b6d3
...
...
@@ -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
({
...
...
src/config/constant.js
View file @
7057b6d3
This diff is collapsed.
Click to expand it.
src/utils/utils.js
View file @
7057b6d3
// 节流
export
function
throttle
(
fn
,
interval
)
{
let
delay
=
interval
||
1500
let
previous
=
0
return
function
()
{
let
now
=
Date
.
now
()
let
that
=
this
let
args
=
arguments
if
(
now
-
previous
>
delay
)
{
fn
.
apply
(
that
,
args
)
previous
=
now
}
let
delay
=
interval
||
1500
let
previous
=
0
return
function
()
{
let
now
=
Date
.
now
()
let
that
=
this
let
args
=
arguments
if
(
now
-
previous
>
delay
)
{
fn
.
apply
(
that
,
args
)
previous
=
now
}
}
}
// 防抖
export
function
debounce
(
fn
,
interval
)
{
let
delay
=
interval
||
1500
let
timer
=
null
return
function
()
{
let
that
=
this
let
args
=
arguments
timer
&&
clearTimeout
(
timer
)
timer
=
setTimeout
(
function
()
{
fn
.
apply
(
that
,
args
)
},
delay
)
}
let
delay
=
interval
||
1500
let
timer
=
null
return
function
()
{
let
that
=
this
let
args
=
arguments
timer
&&
clearTimeout
(
timer
)
timer
=
setTimeout
(
function
()
{
fn
.
apply
(
that
,
args
)
},
delay
)
}
}
var
unique
=
0
;
export
function
uuid
(
prefix
)
{
const
time
=
Date
.
now
();
const
random
=
Math
.
floor
(
Math
.
random
()
*
1000000000
);
unique
++
;
return
prefix
+
'_'
+
random
+
unique
+
String
(
time
);
const
time
=
Date
.
now
();
const
random
=
Math
.
floor
(
Math
.
random
()
*
1000000000
);
unique
++
;
return
prefix
+
'_'
+
random
+
unique
+
String
(
time
);
}
// 一维数组转换成二维数组
export
const
groupList
=
(
list
,
length
)
=>
{
const
pages
=
[];
list
.
forEach
((
item
,
index
)
=>
{
const
page
=
Math
.
floor
(
index
/
length
);
if
(
!
pages
[
page
])
{
pages
[
page
]
=
[];
}
pages
[
page
].
push
(
item
);
});
return
pages
;
};
const
pages
=
[];
list
.
forEach
((
item
,
index
)
=>
{
const
page
=
Math
.
floor
(
index
/
length
);
if
(
!
pages
[
page
])
{
pages
[
page
]
=
[];
}
pages
[
page
].
push
(
item
);
});
return
pages
;
};
/**
* 获取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
/**
* 获取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
src/views/Home/index.vue
View file @
7057b6d3
...
...
@@ -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
;
...
...
src/views/Search/external.vue
View file @
7057b6d3
...
...
@@ -165,13 +165,13 @@ export default {
// 获取验证码
getCaptcha
()
{
this
.
uuid
=
getUUID
();
this
.
$http
.
get
(
`/gs1/office/captcha.jpg?uuid=
${
this
.
uuid
}
`
,
{
responseType
:
"blob"
,
})
.
then
((
res
)
=>
{
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
});
const
query
=
{
uuid
:
this
.
uuid
,
};
this
.
$api
.
getCaptcha
(
query
).
then
((
res
)
=>
{
console
.
log
(
res
,
'res'
);
this
.
captchaPath
=
window
.
URL
.
createObjectURL
(
res
.
body
);
});
},
handleSearch
()
{
this
.
searchCodeShow
=
this
.
search
.
code
;
...
...
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