Commit b2e15b95 by 胡悦

修改商户传参

1 parent 2c3acef8
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
"axios": "^0.21.1", "axios": "^0.21.1",
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "glsx-common": "^1.4.0",
"glsx-table": "^1.1.0", "glsx-components": "^1.0.6",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuex": "^3.1.2" "vuex": "^3.1.2"
...@@ -29,8 +29,6 @@ ...@@ -29,8 +29,6 @@
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-prettier": "^3.1.1", "eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"glsx-common": "^1.4.0",
"glsx-components": "^1.0.4",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"prettier": "^1.19.1", "prettier": "^1.19.1",
"sass-loader": "^8.0.0", "sass-loader": "^8.0.0",
......
...@@ -52,5 +52,13 @@ const staticRoutes = Object.freeze([{ ...@@ -52,5 +52,13 @@ const staticRoutes = Object.freeze([{
url: 'http://192.168.1.68:5501/html/role/index.html' url: 'http://192.168.1.68:5501/html/role/index.html'
} }
}, },
{
name: 'Role',
path: '/role/add',
component: resolve => require([`@/views/role/add.vue`], resolve),
meta: {
url: 'http://192.168.1.68:5501/html/role/add.html'
}
}
]) ])
export default staticRoutes export default staticRoutes
\ No newline at end of file \ No newline at end of file
...@@ -5,27 +5,27 @@ ...@@ -5,27 +5,27 @@
</template> </template>
<script> <script>
const params = {
merchantAccountLevel: 1,
merchantId: 81,
model: 2
}
export default { export default {
name: 'account', name: 'account',
data() { data() {
return { return {
// url: `${this.$router.currentRoute.meta.url}?merchantAccountLevel=${merchantAccountLevel}&merchantId=${merchantId}`
url: '' url: ''
} }
}, },
mounted() { mounted() {
console.log(this.$common) const {session, session: {accountLevel, merchantModel, merchantId, sessionId}} = this.$globalState
const params = {
accountLevel,
merchantModel,
merchantId,
sessionId
}
console.log(params)
this.url = this.$router.currentRoute.meta.url + '?' + this.$common.utils.genUrlParams(params) this.url = this.$router.currentRoute.meta.url + '?' + this.$common.utils.genUrlParams(params)
}, },
methods: { methods: {
subscribe(child) { subscribe(child) {
child.on('route-to', params => { child.on('route-to', params => {
console.log(params, '-----------------------')
this.$history.push(params.path) this.$history.push(params.path)
}) })
} }
......
<template> <template>
<div> <div>
<GLExternal :url="url" :subscribe="subscribe"></GLExternal> <GLExternal v-if="url" :url="url" :subscribe="subscribe"></GLExternal>
</div> </div>
</template> </template>
...@@ -9,13 +9,25 @@ export default { ...@@ -9,13 +9,25 @@ export default {
name: 'adapter', name: 'adapter',
data() { data() {
return { return {
url: this.$router.currentRoute.meta.url url: ''
} }
}, },
mounted() {
const {session, session: {accountLevel, merchantModel, merchantId, sessionId}} = this.$globalState
const params = {
accountLevel,
merchantModel,
merchantId,
sessionId
}
console.log(params)
this.url = this.$router.currentRoute.meta.url + '?' + this.$common.utils.genUrlParams(params)
},
methods: { methods: {
subscribe(child) { subscribe(child) {
child.on('route-to', params => { child.on('route-to', params => {
this.$history.push(params) console.log(params)
this.$history.push(params.path)
}) })
} }
} }
......
<template>
<div>
<GLExternal :url="url" :subscribe="subscribe"></GLExternal>
</div>
</template>
<script>
export default {
name: 'adapter',
data() {
return {
url: this.$router.currentRoute.meta.url
}
},
methods: {
subscribe(child) {
child.on('route-to', params => {
this.$history.push(params)
})
}
}
}
</script>
<style></style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!