parent
cd80917350
commit
1b4482ef34
@ -1,10 +1,23 @@
|
||||
import styles from './index.less';
|
||||
import { message } from 'antd';
|
||||
import Fetch from '@/utils/fetch';
|
||||
import { useEffect } from 'react';
|
||||
|
||||
export default function IndexPage() {
|
||||
console.log(22);
|
||||
useEffect(() => {
|
||||
getData();
|
||||
}, []);
|
||||
const getData = async () => {
|
||||
const res = await Fetch('/openi/resource/clickOpenResource', {
|
||||
method: 'post',
|
||||
});
|
||||
console.log(res);
|
||||
};
|
||||
return (
|
||||
<div>
|
||||
<h1 className={styles.title}>Page index</h1>
|
||||
<h1 onClick={() => message.info(2222)} className={styles.title}>
|
||||
Page index
|
||||
</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,7 @@
|
||||
const env = {
|
||||
dev: 'https://testxgd.educoder.net',
|
||||
build: 'https://testxgd.educoder.net',
|
||||
};
|
||||
console.log('当前环境:', process.env.NODE_ENV);
|
||||
const url = process.env.NODE_ENV === '"development"' ? env.dev : env.build;
|
||||
export default url;
|
Loading…
Reference in new issue