Commit 65c4ae65 by liwk

commit

1 parent 8b01419b
...@@ -2669,6 +2669,11 @@ ...@@ -2669,6 +2669,11 @@
"integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
"dev": true "dev": true
}, },
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc="
},
"check-types": { "check-types": {
"version": "7.4.0", "version": "7.4.0",
"resolved": "http://registry.npm.taobao.org/check-types/download/check-types-7.4.0.tgz", "resolved": "http://registry.npm.taobao.org/check-types/download/check-types-7.4.0.tgz",
...@@ -3344,6 +3349,11 @@ ...@@ -3344,6 +3349,11 @@
"which": "^1.2.9" "which": "^1.2.9"
} }
}, },
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs="
},
"crypto-browserify": { "crypto-browserify": {
"version": "3.12.0", "version": "3.12.0",
"resolved": "http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz", "resolved": "http://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz",
...@@ -10380,6 +10390,15 @@ ...@@ -10380,6 +10390,15 @@
"safe-buffer": "^5.0.1" "safe-buffer": "^5.0.1"
} }
}, },
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha1-rdqnqTFo85PxnrKxUJFhjicA+Eg=",
"requires": {
"charenc": ">= 0.0.1",
"crypt": ">= 0.0.1"
}
},
"shebang-command": { "shebang-command": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "http://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz", "resolved": "http://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz",
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"glsx-vue-common": "^1.2.8", "glsx-vue-common": "^1.2.8",
"glsx-vue-components": "^1.0.13", "glsx-vue-components": "^1.0.13",
"sha1": "^1.1.1",
"vee-validate": "^2.1.7", "vee-validate": "^2.1.7",
"vue": "^2.5.17", "vue": "^2.5.17",
"vue-clipboard2": "^0.2.1", "vue-clipboard2": "^0.2.1",
......
import request from './request'
export const orderApi = {
/**获取财务管理列表*/
getBalanceList(data = {}) {
return request(data, 'dj.api.get.equity.order.balance.list.get')
},
}
\ No newline at end of file \ No newline at end of file
import axios from 'axios'
import Qs from 'qs'
axios.defaults.withCredentials = true
let config = JSON.parse(window.localStorage.getItem('GLSX_OSS_EQUITY_CONFIG'))
const baseURL = config.axios.baseURL
const service = axios.create({
baseURL: baseURL,
timeout: 60 * 1000, // 请求超时时间
transformRequest: [function(data) {
return Qs.stringify(data)
}],
})
service.interceptors.request.use(
config => {
return config
}
)
service.interceptors.response.use(
response => {
const dataAxios = response.data
// 这个状态码是和后端约定的
const { code } = dataAxios
// 有 code 代表这是一个后端接口 可以进行进一步的判断
if (code == -1) {
// Notify({ type: 'danger', message })
return dataAxios
}
switch (+code) {
case 0:
return dataAxios
case 20:
case 21:
break
default:
break
}
},
error => {
console.log(error)
console.log(baseURL)
return Promise.reject(error)
})
export default service
\ No newline at end of file \ No newline at end of file
/* // /*
* @Author: limin // * @Author: limin
* @Date: 2019-08-26 18:02:41 // * @Date: 2019-08-26 18:02:41
* @Last Modified by: chenwq // * @Last Modified by: chenwq
* @Last Modified time: 2020-12-22 11:54:03 // * @Last Modified time: 2020-12-22 11:54:03
*/ // */
// import sign from './sign' // // import sign from './sign'
import RequestMethods from './request.methods' // import RequestMethods from './request.methods'
// import util from '@/libs/util.js' // // import util from '@/libs/util.js'
const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => { // const request = (params = {}, method = RequestMethods.GET, noSignAttr = []) => {
// params.source = 'glsx' // // params.source = 'glsx'
// params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637' // // params.appKey = window.location.href.includes('dj.glsx.com.cn') ? 'd7ffc3346fc9a45bccaaa35300d59022' : '48e5e13229b82c1b4e6e8c96151f0637'
// params.timestamp = new Date().getTime() // // params.timestamp = new Date().getTime()
// params.v = '1.0.0' // // params.v = '1.0.0'
// params.format = 'json' // // params.format = 'json'
// params.locale = 'zh_CN' // // params.locale = 'zh_CN'
// if (params.method !== 'dj.api.user.login') { // // if (params.method !== 'dj.api.user.login') {
// params.sessionId = util.cookies.get('token') // // params.sessionId = util.cookies.get('token')
// } // // }
/** // /**
* mock - url = params.method // * mock - url = params.method
* 调后端接口 - url = '' // * 调后端接口 - url = ''
*/ // */
const url = baseConfig.axios.baseURL + params.method // const url = baseConfig.axios.baseURL + params.method
/** // /**
* 调后端接口,请使用以下代码。 // * 调后端接口,请使用以下代码。
*/ // */
var reqData = (method === RequestMethods.POST) ? { // var reqData = (method === RequestMethods.POST) ? {
// baseURL: process.env.VUE_APP_API + '?method=' + params.method, // // baseURL: process.env.VUE_APP_API + '?method=' + params.method,
// baseURL: process.env.VUE_APP_API, // // baseURL: process.env.VUE_APP_API,
// data: sign(params, noSignAttr) // // data: sign(params, noSignAttr)
data: params // data: params
} : { // } : {
// params: sign(params, noSignAttr) // // params: sign(params, noSignAttr)
params: params // params: params
} // }
return axios({ // return axios({
url, // url,
method, // method,
...reqData // ...reqData
}) // })
/** // /**
* mock,请使用以下代码。 // * mock,请使用以下代码。
*/ // */
// return axios({ // // return axios({
// url, // // url,
// method, // // method,
// params: sign(params, noSignAttr) // // params: sign(params, noSignAttr)
// }) // // })
// }
// export default request
import axios from './axios'
import sign from './sign'
import RequestMethods from './request.methods'
let config = JSON.parse(window.localStorage.getItem('GLSX_OSS_EQUITY_CONFIG'))
const request = (params = {}, url, method = RequestMethods.POST, noSignAttr = []) => {
params.method = url.trimStart().trimEnd()
// params.source = 'h5'
params.source = 'glsx'
params.appKey = config.axios.sys.appKey
params.timestamp = new Date().getTime()
// params.timestamp = new Date().format('yyyy-MM-dd hh:mm:ss')
params.v = '1.0.0'
params.format = 'json'
params.locale = 'zh_CN'
console.log(window.$config)
if (method == 'post') {
return axios({
method,
data: sign(params, noSignAttr)
})
} else {
return axios({
method,
params: sign(params, noSignAttr)
})
}
} }
export default request
export default request
\ No newline at end of file \ No newline at end of file
import sha1 from 'sha1'
import qs from 'qs'
let config = JSON.parse(window.localStorage.getItem('GLSX_OSS_EQUITY_CONFIG'))
const { secret } = config.axios.sys
const sign = (params, noSignAttr = []) => {
delete params.sign
var objStr = qs.stringify(params, { arrayFormat: 'indices', encode: false, allowDots: true })
var objVal = objStr.split('&')
var realObj = {}
objVal.forEach(item => {
if (item.split('=')[0] == 'scene') {
realObj.scene = params.scene
} else {
realObj[item.split('=')[0]] = item.split('=')[1]
}
})
const keys = Object.keys(realObj).sort()
var str = []
var obj = null
for (const key in realObj) {
obj = realObj[key]
if (obj === null) {
obj = ''
} else if (typeof obj === 'object') {
obj = JSON.stringify(obj)
}
realObj[key] = obj
}
keys.forEach(e => {
!noSignAttr.includes(e) && str.push(e + realObj[e])
})
realObj.sign = sha1(secret + str.join('') + secret).toUpperCase()
return realObj
}
export default sign
\ No newline at end of file \ No newline at end of file
...@@ -57,20 +57,24 @@ var mixin = { ...@@ -57,20 +57,24 @@ var mixin = {
}) })
} }
} }
const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config' const URL = 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config'
const getConfig = (url = URL + '/oss_rightsAndInterests') => { const getConfig = (url = URL + '/oss_rightsAndInterests') => {
return new Promise(resolve => { return new Promise(resolve => {
const xhr = new XMLHttpRequest() const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => { xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) { if (xhr.readyState === 4 && xhr.status === 200) {
let config = JSON.parse(xhr.responseText)
window.localStorage.setItem('GLSX_OSS_EQUITY_CONFIG', xhr.responseText)
resolve({ resolve({
'vue': Vue, 'vue': Vue,
'config': JSON.parse(xhr.responseText) 'config': config
}) })
} }
} }
xhr.open('GET', url) xhr.open('GET', url)
xhr.send() xhr.send()
}) })
} }
/* eslint-disable no-new */ /* eslint-disable no-new */
...@@ -81,7 +85,7 @@ const render = App => { ...@@ -81,7 +85,7 @@ const render = App => {
render: h => h(App) render: h => h(App)
}) })
} }
getConfig()
export default { export default {
render, render,
getConfig getConfig
......
...@@ -270,6 +270,7 @@ export default { ...@@ -270,6 +270,7 @@ export default {
params.sort = this.sort === 'descending' ? 1 : 0 params.sort = this.sort === 'descending' ? 1 : 0
} }
// console.log(params) // console.log(params)
console.log(1)
this.getListApi(params).then(res => { this.getListApi(params).then(res => {
this.data = res[this.tableParams.listName] this.data = res[this.tableParams.listName]
this.total = res.total this.total = res.total
......
...@@ -116,10 +116,7 @@ ...@@ -116,10 +116,7 @@
slot-scope="scope" slot-scope="scope"
:data="scope.scope" :data="scope.scope"
> >
<el-button <el-button type="text">查看详情</el-button>
type="text"
@click="startcollectiondetails(scope.scope)"
>查看详情</el-button>
</span> </span>
<template slot='custom'> <template slot='custom'>
<div class="table-custom"> <div class="table-custom">
...@@ -132,6 +129,7 @@ ...@@ -132,6 +129,7 @@
</template> </template>
<script type='text/ecmascript-6'> <script type='text/ecmascript-6'>
import { orderApi } from '@api/api'
export default { export default {
name: '', name: '',
data () { data () {
...@@ -153,59 +151,11 @@ export default { ...@@ -153,59 +151,11 @@ export default {
label: '售后中', label: '售后中',
value: 4 value: 4
}], }],
tableData: [ tableData: [],
{
cardNo: '123',
activationCode: '恒河猴22',
memberName: 'SS2W',
sn: 1,
updatedDate: 'JKHSJKSH',
cardNoSSS: 'SHJJKHK',
AAA: '掉接口',
BBB: 'SDS1D1擦拭',
CCC: '胜多负少的',
DDD: '试胆大会'
},
{
cardNo: '123',
activationCode: '恒河猴22',
memberName: 'SS2W',
sn: 2,
updatedDate: 'JKHSJKSH',
cardNoSSS: 'SHJJKHK',
AAA: '掉接口',
BBB: 'SDS1D1擦拭',
CCC: '胜多负少的',
DDD: '试胆大会'
},
{
cardNo: '123',
activationCode: '恒河猴22',
memberName: 'SS2W',
sn: 3,
updatedDate: 'JKHSJKSH',
cardNoSSS: 'SHJJKHK',
AAA: '掉接口',
BBB: 'SDS1D1擦拭',
CCC: '胜多负少的',
DDD: '试胆大会'
},
{
cardNo: '123',
activationCode: '恒河猴22',
memberName: 'SS2W',
sn: 4,
updatedDate: 'JKHSJKSH',
cardNoSSS: 'SHJJKHK',
AAA: '掉接口',
BBB: 'SDS1D1擦拭',
CCC: '胜多负少的',
DDD: '试胆大会'
},
],
tableParams: { tableParams: {
// listName: 'list', listName: 'list',
showSummary: true, showSummary: true,
// getListApi: orderApi.getBalanceList,
summaryMethod ({ columns, data }) { summaryMethod ({ columns, data }) {
let sums = [] let sums = []
columns.forEach((column, index) => { columns.forEach((column, index) => {
...@@ -213,7 +163,7 @@ export default { ...@@ -213,7 +163,7 @@ export default {
sums[index] = '合计' sums[index] = '合计'
return return
} }
const values = data.map(item => Number(item[column.property])); const values = data.map(item => Number(item[column.property]))
if (!values.every(value => isNaN(value))) { if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => { sums[index] = values.reduce((prev, curr) => {
const value = Number(curr) const value = Number(curr)
...@@ -287,6 +237,9 @@ export default { ...@@ -287,6 +237,9 @@ export default {
} }
}, },
mounted () { mounted () {
orderApi.getBalanceList().then(res => {
console.log(res)
})
}, },
methods: { methods: {
} }
......
...@@ -19,6 +19,7 @@ module.exports = { ...@@ -19,6 +19,7 @@ module.exports = {
config.plugins.delete('named-chunks') config.plugins.delete('named-chunks')
config.resolve.alias config.resolve.alias
.set('@a', path.resolve(__dirname, './src/assets')) .set('@a', path.resolve(__dirname, './src/assets'))
.set('@api', path.resolve(__dirname, './src/api'))
}, },
configureWebpack: (config) => { configureWebpack: (config) => {
// config.devtool = (mode === 'development') ? 'inline-source-map' : false // config.devtool = (mode === 'development') ? 'inline-source-map' : false
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!