import wx from "weixin-js-sdk-ts";
import { openApi } from "@/api/index";
import wxSign from '@/utils/wxSign';

export default function useWxSign() {
    let createWxConfig = (ticket: string) => {
        let timestamp = wxSign.createTimeStamp()
        let nonceStr = wxSign.createNonceStr()
        return {
            timestamp: timestamp,
            nonceStr,
            signature: wxSign.calcSignature(ticket, nonceStr, timestamp, window.location.href)

        }
    }
    return {
        createWxConfig
    }
}
