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
74c2f858
Commit
74c2f858
authored
Dec 29, 2021
by
林家欣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
联调动态url
parent
276e7eca
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
8 deletions
+38
-8
api.js
src/axios/api.js
+11
-4
main.vue
src/components/main.vue
+20
-4
index.vue
src/views/Home/index.vue
+1
-0
mutation-types.js
src/vuex/mutation-types.js
+1
-0
store.js
src/vuex/store.js
+5
-0
No files found.
src/axios/api.js
View file @
74c2f858
//
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
,
...
...
src/components/main.vue
View file @
74c2f858
...
...
@@ -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
>
src/views/Home/index.vue
View file @
74c2f858
...
...
@@ -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
));
...
...
src/vuex/mutation-types.js
View file @
74c2f858
export
const
SET_MATCHE
=
'setMatche'
;
export
const
SET_URL
=
'setUrl'
;
src/vuex/store.js
View file @
74c2f858
...
...
@@ -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
({
...
...
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