Compare commits
6 Commits
Author | SHA1 | Date |
---|---|---|
IrisVega | 99e4e8b3d8 | |
IrisVega | de67edeb4e | |
IrisVega | 043c0a922a | |
IrisVega | 1d5009c51c | |
IrisVega | bdb34c9bf7 | |
IrisVega | 8e2335bf71 |
|
@ -4,14 +4,14 @@ const bodyParser = require('body-parser');
|
||||||
const cors = require('cors');
|
const cors = require('cors');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = 3000;
|
const port = 4040;
|
||||||
|
|
||||||
app.use(bodyParser.json());
|
app.use(bodyParser.json());
|
||||||
app.use(cors());
|
app.use(cors());
|
||||||
|
|
||||||
// 创建 MySQL 连接
|
// 创建 MySQL 连接
|
||||||
const db = mysql.createConnection({
|
const db = mysql.createConnection({
|
||||||
host: '1.14.200.189',
|
host: '172.17.0.1',
|
||||||
user: 'login_test',
|
user: 'login_test',
|
||||||
password: 'tTiwnNbzMeLFxbLj',
|
password: 'tTiwnNbzMeLFxbLj',
|
||||||
database: 'login_test'
|
database: 'login_test'
|
||||||
|
@ -67,5 +67,5 @@ app.get('*', (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(port, () => {
|
app.listen(port, () => {
|
||||||
console.log(`服务器在 http://localhost:${port} 上运行`);
|
console.log(`服务器在 http://0.0.0.0:${port} 上运行`);
|
||||||
});
|
});
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
async login() {
|
async login() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:3000/api/login', {
|
const response = await fetch('http://1.14.200.189:4040/api/login', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
@ -74,7 +74,7 @@ export default {
|
||||||
},
|
},
|
||||||
async register() {
|
async register() {
|
||||||
try {
|
try {
|
||||||
const response = await fetch('http://localhost:3000/api/register', {
|
const response = await fetch('http://1.14.200.189:4040/api/register', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
@ -97,12 +97,13 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
/* .auth-container {
|
.auth-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
height: calc(100vh);
|
height: calc(100vh);
|
||||||
background-color: #ffe6f2; 淡粉色背景 */
|
background-color: rgba(255,255,255,0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.auth-form {
|
.auth-form {
|
||||||
|
|
Loading…
Reference in New Issue