Commit b656e4b7 by 郑炬波

feat: 本地

parent 3202c7a6
...@@ -52,7 +52,7 @@ test('测试组合支付价格计算', () => { ...@@ -52,7 +52,7 @@ test('测试组合支付价格计算', () => {
const payment = new Payment() const payment = new Payment()
const goodsPrice = 0.3 const goodsPrice = 0.3
const balance = 0.1 const balance = 0.1
const {payAmount, payBalance} = payment.computeAmount(goodsPrice, balance) const {payAmount, payBalance} = payment.computeAmountForCombination(goodsPrice, balance)
expect(payAmount).toBe(0.2) expect(payAmount).toBe(0.2)
expect(payBalance).toBe(0.1) expect(payBalance).toBe(0.1)
}) })
...@@ -61,7 +61,7 @@ test('测试非组合支付价格计算', () => { ...@@ -61,7 +61,7 @@ test('测试非组合支付价格计算', () => {
const payment = new Payment({supportCombination: false}) const payment = new Payment({supportCombination: false})
const goodsPrice = 0.3 const goodsPrice = 0.3
payment.balance = 0.1 payment.balance = 0.1
const {payAmount, payBalance} = payment.computeAmount(goodsPrice) const {payAmount, payBalance} = payment.computeAmount(goodsPrice, PayType.ALIPAY)
expect(payAmount).toBe(0.3) expect(payAmount).toBe(0.3)
expect(payBalance).toBe(0) expect(payBalance).toBe(0)
}) })
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,7 +2,8 @@ let BASE_URL_JAVA = ""; ...@@ -2,7 +2,8 @@ let BASE_URL_JAVA = "";
let BASE_GATEWAY = ""; let BASE_GATEWAY = "";
const isDev = typeof window !== 'undefined' ? window.location.hostname.indexOf("dev") > -1 : false; const isDev = typeof window !== 'undefined' ? window.location.hostname.indexOf("dev") > -1 : false;
const isTest = typeof window !== 'undefined' ? window.location.hostname.indexOf("test") > -1 : false; const isTest = typeof window !== 'undefined' ? window.location.hostname.indexOf("test") > -1 : false;
if(isDev || isTest){ const isLocal = typeof window !== 'undefined' ? window.location.hostname.indexOf("localhost") > -1 : false;
if(isDev || isTest || isLocal){
BASE_URL_JAVA = 'https://testapi.ydl.com'; BASE_URL_JAVA = 'https://testapi.ydl.com';
BASE_GATEWAY = 'https://testapp2.yidianling.com' BASE_GATEWAY = 'https://testapp2.yidianling.com'
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment