|
@@ -0,0 +1,36 @@
|
|
|
+import { Button } from 'react-vant';
|
|
|
+import './index.less'
|
|
|
+import React, { useState } from "react";
|
|
|
+export const Wxcode: React.FC = (props: any) => {
|
|
|
+ const query = new URLSearchParams(window.location.search)
|
|
|
+ const [code] = useState(query.get("code") || "")
|
|
|
+ const [state] = useState(query.get("state") || "")
|
|
|
+ const nkjk1H5 = "https://nbjk1-h5.zzxcx.net/home?code="+code+"&state=LOGIN"
|
|
|
+ const copyText = (text:string)=>{
|
|
|
+
|
|
|
+ let oInput = document.createElement("input");
|
|
|
+ oInput.value = text;
|
|
|
+ document.body.appendChild(oInput);
|
|
|
+ oInput.select(); // 选择对象;
|
|
|
+ document.execCommand("Copy"); // 执行浏览器复制命令
|
|
|
+ console.log('复制成功')
|
|
|
+ oInput.remove();
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ <div className='Wxcode'>
|
|
|
+ <div className='col'>
|
|
|
+ <div>code:{code}</div>
|
|
|
+ <div style={{
|
|
|
+ display:'flex',
|
|
|
+ justifyContent:'space-between'
|
|
|
+ }} className=''>
|
|
|
+ <Button onClick={()=>{copyText(code)}} type='primary'>复制code</Button>
|
|
|
+ <Button onClick={()=>{copyText(nkjk1H5)}} type='primary'>复制测试服地址</Button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>state:{state}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+
|
|
|
+}
|