Commit 8beeef96 by liwk

提交代码

1 parent 9d2cbddb
...@@ -9,8 +9,10 @@ ...@@ -9,8 +9,10 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"blueimp-md5": "^2.10.0",
"glsx-vue-common": "^1.1.14", "glsx-vue-common": "^1.1.14",
"glsx-vue-components": "^1.0.13", "glsx-vue-components": "^1.0.13",
"js-md5": "^0.7.3",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"vee-validate": "^2.1.7", "vee-validate": "^2.1.7",
......
import {
GlAxios
} from 'glsx-vue-common'
const path = '/glsx.accounts.admin.merchant.' const path = '/glsx.accounts.admin.merchant.'
const __sGetList = `${path}search` const methods = {
const __sDetail = `${path}detail` Search: `${path}search`,
const __sPersonal = `${path}personal` Detail: `${path}detail`,
const __sGroup = `${path}group` Personal: `${path}personal`,
const __sSaveMerchant = `${path}create` Group: `${path}group`,
const __sLevel = `${path}group.level` Create: `${path}create`,
GroupLevel: `${path}group.level`
// 获取商户列表(根据条件获取商户列表)
const getList = {
p: [__sGetList],
req: params => GlAxios.get(__sGetList, {
params
})
} }
// 获取商户详情(通过商户id获取商户详情)
const merchantDetail = {
p: [__sDetail],
req: params => GlAxios.get(__sDetail, {
params
})
}
// 获取员工信息(通过商户id获取员工信息)
const merchantPersonal = {
p: [__sPersonal],
req: params => GlAxios.get(__sPersonal, {
params
})
}
// 获取分组信息(通过商户id获取分组信息)
const merchantGroup = {
p: [__sGroup],
req: params => GlAxios.get(__sGroup, {
params
})
}
// 新增商户
const saveMerchant = {
p: [__sSaveMerchant],
req: params => GlAxios.get(__sSaveMerchant, {
params
})
}
// 根据分组跟商户查询父子商户
const merchantGroupLevel = {
p: [__sLevel],
req: params => GlAxios.get(__sLevel, {
params
})
}
export { export {
getList, methods
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
} }
import { import {
getBusinessList GlAxios
} from './businessManagement' } from 'glsx-vue-common'
import { sign } from './sign'
import { import {
getList, methods as bizMethods
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
} from './bussinessListApi' } from './bussinessListApi'
const request = {
req: params => {
const url = process.env.NODE_ENV === 'production' ? 'router' : params.methods
return GlAxios.get(url, { 'params': sign(params) })
}
}
export { export {
getBusinessList, bizMethods,
getList, request
merchantDetail,
merchantPersonal,
merchantGroup,
saveMerchant,
merchantGroupLevel
} }
import MD5 from 'js-md5'
const sign = params => {
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b'
const keys = Object.keys(params).sort()
var str = []
keys.forEach(e => {
str.push(e + params[e])
})
console.log(str)
params.sign = MD5(secret + str.join('') + secret)
console.log(params.sign)
return params
}
export {
sign
}
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
<script> <script>
import SearchDialog from './SearchDialog' import SearchDialog from './SearchDialog'
import AddDialog from './AddDialog' import AddDialog from './AddDialog'
import { getList, saveMerchant } from '@/api/bussinessListApi' import { bizMethods, request } from '@/api'
import notice from '@/common/notice' import notice from '@/common/notice'
export default { export default {
name: 'businessList', name: 'businessList',
...@@ -150,7 +150,8 @@ export default { ...@@ -150,7 +150,8 @@ export default {
// 接口请求-start // 接口请求-start
getList() { getList() {
const params = this.getParams() const params = this.getParams()
getList.req(params).then(res => { params.methods = bizMethods.Search
request.req(params).then(res => {
this.ListTableData.data = res.merchants this.ListTableData.data = res.merchants
this.total = res.pagination.totalCount this.total = res.pagination.totalCount
this.reset(this.merchantSearch) this.reset(this.merchantSearch)
...@@ -161,7 +162,7 @@ export default { ...@@ -161,7 +162,7 @@ export default {
}) })
}, },
saveMerchant() { saveMerchant() {
saveMerchant.req(this.merchantForm).then(res => { request.req(this.merchantForm).then(res => {
notice.okTips() notice.okTips()
this.reset(this.merchantForm) this.reset(this.merchantForm)
}).catch(err => { }).catch(err => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!