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

main
yuan 4 months ago
parent 83287432b0
commit 010846562f

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

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

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

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