Compare commits

..

1 Commits

Author SHA1 Message Date
IrisVega efd942dd7c modified: src/components/LoginForm.vue 2024-07-11 17:25:25 +08:00
2 changed files with 8 additions and 8 deletions

View File

@ -4,14 +4,14 @@ const bodyParser = require('body-parser');
const cors = require('cors');
const path = require('path');
const app = express();
const port = 4040;
const port = 3000;
app.use(bodyParser.json());
app.use(cors());
// 创建 MySQL 连接
const db = mysql.createConnection({
host: '172.17.0.1',
host: '1.14.200.189',
user: 'login_test',
password: 'tTiwnNbzMeLFxbLj',
database: 'login_test'
@ -67,5 +67,5 @@ app.get('*', (req, res) => {
});
app.listen(port, () => {
console.log(`服务器在 http://0.0.0.0:${port} 上运行`);
console.log(`服务器在 http://localhost:${port} 上运行`);
});

View File

@ -55,7 +55,7 @@ export default {
methods: {
async login() {
try {
const response = await fetch('http://1.14.200.189:4040/api/login', {
const response = await fetch('http://localhost:3000/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@ -74,7 +74,7 @@ export default {
},
async register() {
try {
const response = await fetch('http://1.14.200.189:4040/api/register', {
const response = await fetch('http://localhost:3000/api/register', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
@ -97,12 +97,12 @@ export default {
</script>
<style scoped>
.auth-container {
auth-container {
display: flex;
justify-content: center;
align-items: center;
height: calc(100vh);
background-color: rgba(255,255,255,0);
height: calc(100vh-100px);
background-color: rgba(255,255,255,0);
}