|
|
@ -51,7 +51,9 @@ |
|
|
import * as w6s from 'szient-js-sdk'; |
|
|
import * as w6s from 'szient-js-sdk'; |
|
|
import sha1 from 'crypto-js/sha1'; |
|
|
import sha1 from 'crypto-js/sha1'; |
|
|
import {getEnterpriseMerchantAuthorization,getSiqLoginAuth, getSiqLoginAuthTest} from '../api/Home'; |
|
|
import {getEnterpriseMerchantAuthorization,getSiqLoginAuth, getSiqLoginAuthTest} from '../api/Home'; |
|
|
const { useCommon } = $globalStore; |
|
|
import {showSuccessToast} from "vant"; |
|
|
|
|
|
import 'vant/es/toast/style'; |
|
|
|
|
|
const { useCommon } = $globalStore; |
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
const route = useRoute(); |
|
|
const route = useRoute(); |
|
|
let carouselList = reactive([]); // 轮播列表 |
|
|
let carouselList = reactive([]); // 轮播列表 |
|
|
@ -84,7 +86,6 @@ const boutiqueGoods = async () => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const toRegisterView = async() =>{ |
|
|
const toRegisterView = async() =>{ |
|
|
console.log(useCommon.enterpriseNumber); |
|
|
|
|
|
if(useCommon.enterpriseNumber == null || useCommon.enterpriseNumber == ""){ |
|
|
if(useCommon.enterpriseNumber == null || useCommon.enterpriseNumber == ""){ |
|
|
router.push({ path: "/enterprise/register" }); |
|
|
router.push({ path: "/enterprise/register" }); |
|
|
}else{ |
|
|
}else{ |
|
|
@ -129,6 +130,16 @@ const generateRandomNumber =() =>{ |
|
|
const randomNum = (Math.floor(Math.random() * (max - min + 1)) + min); |
|
|
const randomNum = (Math.floor(Math.random() * (max - min + 1)) + min); |
|
|
return randomNum.toString().padStart(6, '0'); |
|
|
return randomNum.toString().padStart(6, '0'); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getEnterpriseMerchant =(phoneNumber) => { |
|
|
|
|
|
getEnterpriseMerchantAuthorization({merchantTel: phoneNumber},success =>{ |
|
|
|
|
|
if(!(success.data == null && success.data.length == 0)){ |
|
|
|
|
|
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber); |
|
|
|
|
|
} |
|
|
|
|
|
},error =>{ |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
onMounted(() => { |
|
|
// console.log(useCommon.phonenumber) |
|
|
// console.log(useCommon.phonenumber) |
|
|
// useCommon.SET_USER_PHONENUMBER(success.data.phonenumber); |
|
|
// useCommon.SET_USER_PHONENUMBER(success.data.phonenumber); |
|
|
@ -147,11 +158,12 @@ onMounted(() => { |
|
|
// 最终还需要转成全小写 |
|
|
// 最终还需要转成全小写 |
|
|
const signature = sha1(str).toString().toLowerCase(); |
|
|
const signature = sha1(str).toString().toLowerCase(); |
|
|
|
|
|
|
|
|
// //深i企鉴权 |
|
|
// //深i企鉴权测试 |
|
|
getSiqLoginAuthTest({userId: "1608644307579883522", userName: "汪鑫"},success =>{ |
|
|
// getSiqLoginAuthTest({userId: "1608644307579883522", userName: "汪鑫"},success =>{ |
|
|
console.log(success.data) |
|
|
// useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber); |
|
|
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber); |
|
|
// useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString()); |
|
|
},error =>{}) |
|
|
// console.log("phone : "+useCommon.phonenumber); |
|
|
|
|
|
// },error =>{}) |
|
|
|
|
|
|
|
|
w6s.config({ |
|
|
w6s.config({ |
|
|
access_key: access_key, |
|
|
access_key: access_key, |
|
|
@ -175,11 +187,14 @@ onMounted(() => { |
|
|
success: function(res) { |
|
|
success: function(res) { |
|
|
console.log(res) |
|
|
console.log(res) |
|
|
console.log("认证",res); |
|
|
console.log("认证",res); |
|
|
console.log(res.result.result.code) |
|
|
console.log("code: "+res.result.result.code); |
|
|
getSiqLoginAuth({code: res.result.result.code},success =>{ |
|
|
getSiqLoginAuth({code: res.result.result.code},success =>{ |
|
|
console.log(success.data) |
|
|
useCommon.SET_USER_PHONENUMBER(success.data.phonenumber.toString()); |
|
|
|
|
|
useCommon.SET_USER_ID(success.data.userId); |
|
|
|
|
|
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data.enterpriseNumber); |
|
|
|
|
|
getEnterpriseMerchant(success.data.phonenumber.toString()); |
|
|
},error =>{ |
|
|
},error =>{ |
|
|
|
|
|
console.log("error : "+ error) |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
fail: function(err) { |
|
|
fail: function(err) { |
|
|
@ -189,12 +204,13 @@ onMounted(() => { |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{ |
|
|
// getEnterpriseMerchantAuthorization({merchantTel: useCommon.phonenumber},success =>{ |
|
|
if(!(success.data == null && success.data.length == 0)){ |
|
|
// if(!(success.data == null && success.data.length == 0)){ |
|
|
useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber); |
|
|
// console.log("success.data[0].enterpriseNumber :" + success.data[0].enterpriseNumber) |
|
|
} |
|
|
// useCommon.SET_USER_ENTERPRISE_NUMBER(success.data[0].enterpriseNumber); |
|
|
},error =>{ |
|
|
// } |
|
|
}) |
|
|
// },error =>{ |
|
|
|
|
|
// }) |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
|
|
|
|
|
|
|