后端端口修正8080,前端端口修正8081

main
yuan 3 months ago
parent 83287432b0
commit 010846562f

@ -16,7 +16,7 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8081
port: 8081
port: 8080
servlet:
# 应用的访问路径
context-path: /

@ -40,7 +40,7 @@ export default {
},
methods: {
fetchCaptcha() {
fetch('http://localhost:8081/captchaImage')
fetch('http://localhost:8080/captchaImage')
.then(response => response.json()) // JSON
.then(data => {
if (data.code === 200) {
@ -56,35 +56,35 @@ export default {
});
},
async login() {
try {
const response = await axios.post('http://localhost:8081/login', {
username: this.username,
password: this.password,
code: this.code,//
uuid: this.uuid
}, {
headers: {
'Content-Type': 'application/json' // JSON
}
});
console.log('用户名',this.username);
console.log('密码',this.password);
console.log('验证码',this.code);
console.log('uuid',this.uuid);
if (response.data.code === 200) {
console.log('登录成功', response.data);
window.location.href = 'http://localhost:8080'; //
} else {
console.error('登录失败', response.data.msg);
this.refreshCaptcha(); //
try {
const response = await axios.post('http://localhost:8080/login', {
username: this.username,
password: this.password,
code: this.code,//
uuid: this.uuid
}, {
headers: {
'Content-Type': 'application/json' // JSON
}
} catch (error) {
console.error('登录失败', error);
//
this.refreshCaptcha();
});
console.log('用户名',this.username);
console.log('密码',this.password);
console.log('验证码',this.code);
console.log('uuid',this.uuid);
if (response.data.code === 200) {
console.log('登录成功', response.data);
window.location.href = 'http://localhost:8081'; //
} else {
console.error('登录失败', response.data.msg);
this.refreshCaptcha(); //
}
},
} catch (error) {
console.error('登录失败', error);
//
this.refreshCaptcha();
}
},
//
refreshCaptcha() {
this.fetchCaptcha();

@ -39,7 +39,7 @@ export default {
return;
}
try {
const response = await axios.post('http://localhost:8081/register', {
const response = await axios.post('http://localhost:8080/register', {
username: this.username,
password: this.password
});

@ -2,3 +2,8 @@ const { defineConfig } = require('@vue/cli-service')
module.exports = defineConfig({
transpileDependencies: true
})
module.exports = {
devServer: {
port: 8081, // 修改这里的数值即可更改端口
},
};
Loading…
Cancel
Save