Commit 940c33be authored by 郝聪敏's avatar 郝聪敏

fix:openid获取方式修改

parent bcb6e95b
...@@ -92,7 +92,11 @@ axios.interceptors.response.use( ...@@ -92,7 +92,11 @@ axios.interceptors.response.use(
// 后端返回异常信息时提出警告 // 后端返回异常信息时提出警告
if (response.data.code && response.data.msg) notifyType = "warning"; if (response.data.code && response.data.msg) notifyType = "warning";
Notify({ type: notifyType, message: response.data.msg || "后端服务异常" }); Notify({
type: notifyType,
message: response.data.msg || "后端服务异常",
duration: notifyType === "warning" ? 6000 : 3000
});
return Promise.reject(response.data); return Promise.reject(response.data);
}, },
async err => { async err => {
......
...@@ -13,7 +13,6 @@ export default { ...@@ -13,7 +13,6 @@ export default {
return { return {
subFormData: {}, // 组装好的数据 subFormData: {}, // 组装好的数据
orderInfo: {}, orderInfo: {},
openId: localStorage.get("openId"),
tradeType: "", tradeType: "",
payTimer: null, payTimer: null,
isPayWait: false isPayWait: false
...@@ -41,7 +40,7 @@ export default { ...@@ -41,7 +40,7 @@ export default {
}, },
async goPay() { async goPay() {
this.setIsLoading(false); this.setIsLoading(false);
const { tradeType, orderInfo, openId } = this; const { tradeType, orderInfo } = this;
const { payOrderNo, payType } = orderInfo; const { payOrderNo, payType } = orderInfo;
if (!payOrderNo) { if (!payOrderNo) {
this.$toast("请先生成订单"); this.$toast("请先生成订单");
...@@ -52,8 +51,8 @@ export default { ...@@ -52,8 +51,8 @@ export default {
payOrderType: payType, payOrderType: payType,
tradeType tradeType
}; };
if (openId && tradeType === "JSAPI") { if (localStorage.get("openId") && tradeType === "JSAPI") {
params.openId = openId; params.openId = localStorage.get("openId");
} }
this.isPayWait = true; this.isPayWait = true;
const res = await placeOrder.pay(params); const res = await placeOrder.pay(params);
......
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