api url
This commit is contained in:
parent
6019a40835
commit
a5a01f392b
|
@ -74,7 +74,7 @@ export default class App extends Component {
|
||||||
const hash = window.location.hash.replace(/^#/, '')
|
const hash = window.location.hash.replace(/^#/, '')
|
||||||
|
|
||||||
if (hash && hash !== 'close' && hash !== 'help' && hash !== this.state.response.hash) {
|
if (hash && hash !== 'close' && hash !== 'help' && hash !== this.state.response.hash) {
|
||||||
axios.get(this.apiUrl, { params: { hash } }).then((res) => {
|
axios.get('/api/preg', { params: { hash } }).then((res) => {
|
||||||
this.setState({ ...res.data, response: {} }, () => {
|
this.setState({ ...res.data, response: {} }, () => {
|
||||||
this.api()
|
this.api()
|
||||||
})
|
})
|
||||||
|
@ -101,7 +101,7 @@ export default class App extends Component {
|
||||||
api = () => {
|
api = () => {
|
||||||
const { response, help, ...state } = this.state
|
const { response, help, ...state } = this.state
|
||||||
|
|
||||||
axios.post(this.apiUrl, state).then((res) => {
|
axios.post('/api/preg', state).then((res) => {
|
||||||
this.setState({ response: res.data }, () => {
|
this.setState({ response: res.data }, () => {
|
||||||
if ('hash' in res.data) {
|
if ('hash' in res.data) {
|
||||||
window.location.hash = '#'+res.data.hash;
|
window.location.hash = '#'+res.data.hash;
|
||||||
|
|
Loading…
Reference in New Issue