提交部分修改

This commit is contained in:
xiaogang 2025-12-19 18:08:19 +08:00
parent be6c10a69f
commit 7a434ce738
3 changed files with 18 additions and 5 deletions

View File

@ -58,3 +58,10 @@ export const queryOrderState = (params) => http({
...params ...params
}) })
//SM3签名
export const getSM3Sign = (params) => http({
url:'/api/v1/sign',
method:'POST',
...params
})

View File

@ -1,4 +1,5 @@
import md5 from 'js-md5'; import md5 from 'js-md5';
import getSM3Sign from '@/api/ycnc'
export default function useCode(){ export default function useCode(){
return new Promise((resolve,reject) => { return new Promise((resolve,reject) => {
const authCallback = (params) => { const authCallback = (params) => {
@ -6,15 +7,19 @@ export default function useCode(){
const {code} = params const {code} = params
resolve(code) resolve(code)
} }
const getNewAuthorization = () => { const getNewAuthorization = async () => {
let appId = import.meta.env.VITE_YCNC_APPID; let appId = import.meta.env.VITE_YCNC_APPID;
let time = Date.now().toString(); let time = Date.now().toString();
let secret = import.meta.env.VITE_YCNC_SECRET; //MD5加密
let signBefore = appId + time + secret; // let secret = import.meta.env.VITE_YCNC_SECRET;
let sign = md5(signBefore);//普通md5 // let signBefore = appId + time + secret;
// let sign = md5(signBefore);
//sm3加密
let {data} = await getSM3Sign({params:{appId,time}})
let param = { let param = {
appId: appId, appId: appId,
sign: sign, // sign: sign,
sign: data.sign,
time: time, time: time,
tran_code: "157", tran_code: "157",
fn: "authCallback", fn: "authCallback",

View File

@ -57,6 +57,7 @@
}) })
} }
provide('custom-events',{ provide('custom-events',{
handleBuy, handleBuy,
goDetail goDetail