This commit is contained in:
subaixi 2024-12-21 17:26:18 +08:00
parent b533c4205c
commit fdcb6479e7
6 changed files with 33 additions and 9 deletions

View File

@ -1 +1 @@
VITE_BASE_URL='http://alb-116396619.us-east-1.elb.amazonaws.com:80' VITE_BASE_URL='http://zoo-backend:12321'

View File

@ -1,3 +1,20 @@
# 动物信息管理系统说明
## 简介
本人负责动物信息管理系统的前端部分,该项目为大作业所作,由于不擅长前端,所以很烂
加载数据很卡,没做优化,卡住的话耐心等待几秒吧
## 账户密码都是123456
管理员账户admin
饲养员账户user2
兽医账户user4
# zoo-frontend大报告要求 # zoo-frontend大报告要求
本次建设的动物信息分为以下功能: 本次建设的动物信息分为以下功能:

View File

@ -8,8 +8,8 @@ export default {
return { return {
// //
form: { form: {
username: '', username: 'admin',
password: '', password: '123456',
}, },
picture: [ picture: [
'https://www4.bing.com//th?id=OHR.BambooPanda_ZH-CN8455481760_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp', 'https://www4.bing.com//th?id=OHR.BambooPanda_ZH-CN8455481760_1920x1080.jpg&rf=LaDigue_1920x1080.jpg&pid=hp',
@ -63,10 +63,10 @@ export default {
}, },
mounted() { mounted() {
//退 //退
this.updateLoginUser(''); // this.updateLoginUser('');
// // //
this.form.username = localStorage.getItem('username'); // this.form.username = localStorage.getItem('username');
} }
} }
</script> </script>

View File

@ -141,7 +141,7 @@ export default {
}) })
}else { }else {
return ElMessage({ return ElMessage({
message: '编辑失败', message: '编辑失败,无权限',
type: 'warning', type: 'warning',
}) })
} }
@ -184,7 +184,7 @@ export default {
}) })
}else { }else {
return ElMessage({ return ElMessage({
message: '删除失败', message: '删除失败,无权限',
type: 'warning', type: 'warning',
}) })
} }

View File

@ -1,7 +1,8 @@
import axios from "axios"; import axios from "axios";
const instance = axios.create({ const instance = axios.create({
baseURL : `${import.meta.env.VITE_BASE_URL}/zoo`, // baseURL : `${window.location.origin}/api/zoo`,
baseURL : `${window.location.origin}/api/zoo`,
}) })
export default { export default {

View File

@ -25,5 +25,11 @@ export default defineConfig({
}, },
server: { server: {
port: 5000, port: 5000,
proxy: {
'/api': {
target: 'http://localhost:8888',
rewrite: (path) => path.replace(/^\/api/, '')
}
}
}, },
}) })