Commit e38fe48c9a845bc6d5e226324c1f6d0abc22a657

Authored by liuqimichale
1 parent 7ddbff4d

接口跨域

build/utils.js
... ... @@ -47,6 +47,7 @@ exports.cssLoaders = function (options) {
47 47 if (options.extract) {
48 48 return ExtractTextPlugin.extract({
49 49 use: loaders,
  50 + publicPath: '../../',
50 51 fallback: 'vue-style-loader'
51 52 })
52 53 } else {
... ...
build/webpack.prod.conf.js
... ... @@ -23,6 +23,7 @@ const webpackConfig = merge(baseWebpackConfig, {
23 23 },
24 24 devtool: config.build.productionSourceMap ? config.build.devtool : false,
25 25 output: {
  26 + publicPath: './',
26 27 path: config.build.assetsRoot,
27 28 filename: utils.assetsPath('js/[name].[chunkhash].js'),
28 29 chunkFilename: utils.assetsPath('js/[id].[chunkhash].js')
... ... @@ -46,7 +47,7 @@ const webpackConfig = merge(baseWebpackConfig, {
46 47 filename: utils.assetsPath('css/[name].[contenthash].css'),
47 48 // Setting the following option to `false` will not extract CSS from codesplit chunks.
48 49 // Their CSS will instead be inserted dynamically with style-loader when the codesplit chunk has been loaded by webpack.
49   - // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
  50 + // It's currently set to `true` because we are seeing that sourcemaps are included in the codesplit bundle as well when it's `false`,
50 51 // increasing file size: https://github.com/vuejs-templates/webpack/issues/1110
51 52 allChunks: true,
52 53 }),
... ...
config/index.js
... ... @@ -10,15 +10,15 @@ module.exports = {
10 10 // Paths
11 11 assetsSubDirectory: 'static',
12 12 assetsPublicPath: '/',
13   - proxyTable: {
14   - '/api':{
15   - target:"http://39.98.58.92:8090/",//这里设置你要访问的域名(或IP+端口)
16   - changeOrigin:true,
17   - pathRewrite:{
18   - '^/api':''//base_api是自定义用来代替http://www.baidu.com/的
19   - }
20   - }
21   - },
  13 + // proxyTable: {
  14 + // '/api':{
  15 + // target:"http://39.98.58.92:8090/",//这里设置你要访问的域名(或IP+端口)
  16 + // changeOrigin:true,
  17 + // pathRewrite:{
  18 + // '^/api':''//base_api是自定义用来代替http://pay.service.huangshiparking.com/的
  19 + // }
  20 + // }
  21 + // },
22 22  
23 23  
24 24 // Various Dev Server settings
... ... @@ -52,7 +52,7 @@ module.exports = {
52 52 // Paths
53 53 assetsRoot: path.resolve(__dirname, '../dist'),
54 54 assetsSubDirectory: 'static',
55   - assetsPublicPath: '/',
  55 + assetsPublicPath: './',
56 56  
57 57 /**
58 58 * Source Maps
... ...
src/api/orderPay/orderPay.js
... ... @@ -2,7 +2,7 @@ import request from '@/utils/request'
2 2  
3 3 export function aliPay(params) { // 支付宝
4 4 return request({
5   - url: '/api/alipay/aliH5Pay',
  5 + url: 'alipay/aliH5Pay',
6 6 method: 'post',
7 7 data: params
8 8 })
... ... @@ -11,7 +11,7 @@ export function aliPay(params) { // 支付宝
11 11  
12 12 export function getOpenId(params) { // 获取OpenId
13 13 return request({
14   - url: '/api//weixinPublicPay/getOpenIdByCode',
  14 + url: 'weixinPublicPay/getOpenIdByCode',
15 15 method: 'post',
16 16 data: params
17 17 })
... ... @@ -19,7 +19,7 @@ export function getOpenId(params) { // 获取OpenId
19 19  
20 20 export function vxPayQuery(params) { // 微信
21 21 return request({
22   - url: '/api//weixinpay/publicUnifiedOrder',
  22 + url: 'weixinpay/publicUnifiedOrder',
23 23 method: 'post',
24 24 data: params
25 25 })
... ...
src/api/parkRecord/parkRecord.js
... ... @@ -2,7 +2,7 @@ import request from '@/utils/request'
2 2  
3 3 export function parkRecordList(params) {
4 4 return request({
5   - url: '/api/queryParkOrder/queryParkingRecordPageByCarNumbers',
  5 + url: 'queryParkOrder/queryParkingRecordPageByCarNumbers',
6 6 method: 'post',
7 7 data: params
8 8 })
... ... @@ -10,7 +10,7 @@ export function parkRecordList(params) {
10 10  
11 11 export function historyQuery(params) {
12 12 return request({
13   - url: '/api/queryParkOrder/queryArrearageStaForWXPublc',
  13 + url: 'queryParkOrder/queryArrearageStaForWXPublc',
14 14 method: 'post',
15 15 data: params
16 16 })
... ... @@ -18,7 +18,7 @@ export function historyQuery(params) {
18 18  
19 19 export function parkingQuery(params) {
20 20 return request({
21   - url: '/api/queryParkOrder/billQuery',
  21 + url: 'queryParkOrder/billQuery',
22 22 method: 'post',
23 23 data: params
24 24 })
... ...
src/components/orderPay.vue
... ... @@ -100,14 +100,16 @@ export default {
100 100  
101 101 if (this.clientBrowser == '支付宝') { // 支付宝支付
102 102 var aliParams = {};
  103 + console.log(this.orderId)
  104 + console.log(typeof this.orderId)
103 105 aliParams.orderId = this.orderId;
104 106 aliParams.carNumber = this.carNumber;
105 107 aliParams.payType = 1;// 1:支付宝 2:微信 3:银联 10:H5 4微信公众号
106 108 aliParams.terminalSource = 7;//请求端来源 1: 任你停 2:pda 3:微信公共号 7:H5扫码 10页面支付
107 109 aliParams.paySrcType = this.paySrcType;//101停车支付
108 110 aliParams.orgId = this.$utils.myOrgId,
109   - aliParams.backType = 2,
110   - aliParams.recordArreaInfos = JSON.stringify(this.orderId);
  111 + aliParams.backType = 2,
  112 + aliParams.recordArreaInfos = JSON.stringify(this.orderId);
111 113  
112 114 aliPay(aliParams).then(response => {
113 115 console.log(response)
... ...
src/components/parkRecord.vue
... ... @@ -48,7 +48,7 @@
48 48  
49 49 <!--历史缴费-->
50 50 <div v-show="currentTabActive==1" class="history-con" >
51   - <div v-if="historyList.length>0">
  51 + <div v-if="historyList.length>0" style="height: 100%;">
52 52 <div class="history-body" >
53 53 <p class="money-all">总欠费金额:
54 54 <span>¥{{(allMoney/100).toFixed(2)}}</span>
... ...
src/utils/request.js
... ... @@ -7,8 +7,8 @@ const service = axios.create({
7 7 // baseURL: 'http://39.98.54.240:8090', // url = base url + request url
8 8 //baseURL: _url, // url = base url + request url
9 9  
10   - // baseURL: 'http://39.98.54.240:8090', // url = base url + request url
11   - withCredentials: true, // send cookies when cross-domain requests
  10 + baseURL: 'http://pay.service.huangshiparking.com/', // url = base url + request url
  11 + // withCredentials: true, // send cookies when cross-domain requests
12 12 timeout: 6000 // request timeout
13 13 })
14 14  
... ...
src/utils/utils.js
... ... @@ -25,13 +25,13 @@ export default {
25 25 }
26 26 }
27 27 objb.sort(compare);
28   - var strmd5 = 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
  28 + var strmd5 = '14318527b13840c2a4af63fef52c2d6e';
29 29 for(var i=0;i<objb.length;i++){
30 30 if(objb[i].value != null&&objb[i].value != ''){
31 31 strmd5 += objb[i].keyname+objb[i].value;
32 32 }
33 33 }
34   - strmd5 += 'ny1u72b6k374sg379z0kqjgfxe2ycnpw';
  34 + strmd5 += '14318527b13840c2a4af63fef52c2d6e';
35 35 // console.log('strmd5-------->'+strmd5);
36 36 strmd5 = md5(strmd5);
37 37 strmd5=strmd5.toUpperCase();
... ... @@ -111,11 +111,17 @@ export default {
111 111 },
112 112 // 0eca8f5373ca4866aec2f8e9d9367104 老的id
113 113 // 14318527b13840c2a4af63fef52c2d6e 老的签名
114   - myVarAppid:'ud8yq5tv0inxupc05xfeau39jywlqoj2',// 公共请求Appid
  114 +
  115 +
  116 + // ud8yq5tv0inxupc05xfeau39jywlqoj2 新的id
  117 + // ny1u72b6k374sg379z0kqjgfxe2ycnpw 新的签名
  118 +
  119 +
  120 + myVarAppid:'0eca8f5373ca4866aec2f8e9d9367104',// 公共请求Appid
115 121  
116 122 myDeviceInfo: 'BC0703A4-AFB0-4B51-9089-9B7487C0CC6E', // 公共请求设备信息
117 123  
118   - myVxAppId: 'wx2af2bab90d433c86' , // 微信赤峰 appid
  124 + myVxAppId: 'wxa1a66cc7d263afe6' , // 微信赤峰 appid //黄石 appid wxa1a66cc7d263afe6
119 125  
120 126 myOrgId: '10003' // 归属地 赤峰id
121 127  
... ...