master
Aaron Yu 2022-01-24 20:11:46 +08:00
parent dea09d52cf
commit 8ffeb52090
2 changed files with 3 additions and 4 deletions

View File

@ -28,7 +28,7 @@ class App extends React.Component {
refreshQrCode() {
var {selectedProject} = this.state;
var rawUrl = encodeURI(BaseUrl + selectedProject.HtmlUrl)
var rawUrl = encodeURI(!selectedProject?.HtmlUrl?.startsWith("http") ? BaseUrl + selectedProject.HtmlUrl : selectedProject.HtmlUrl)
selectedProject.HtmlUrl && QrCode.toDataURL([{ data: rawUrl, mode: 'byte'}], { width: 120 })
.then((dataUrl) => {
this.setState({

View File

@ -8,11 +8,10 @@ import ipadVPng from '../../images/iPad-v.png'
import copyPng from '../../images/copy.png'
import refreshButtonPng from '../../images/refresh-button.png'
import {CopyToClipboard} from 'react-copy-to-clipboard';
import React, { createRef, useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { BaseUrl } from '../../constants'
import { Alert, Snackbar } from '@mui/material'
var baseUrl = "http://123.56.161.61:1157/"
var configMap = {
"android-h": {
bkg: androidHPng,
@ -64,7 +63,7 @@ function DeviceFrame(props) {
useEffect(() => {
console.log('触发更新', props.htmlUrl);
setAbsoluteUrl(!props.htmlUrl?.startsWith("http") ? BaseUrl + props.htmlUrl : props.htmlUrl);
props.htmlUrl && setAbsoluteUrl(!props.htmlUrl.startsWith("http") ? BaseUrl + props.htmlUrl : props.htmlUrl);
refresh()
props.refreshQrCode()
}, [props.htmlUrl])