diff --git a/node_modules/.cache/eslint/7dc60d80.json b/node_modules/.cache/eslint/7dc60d80.json index 83e354e1..743a29b2 100644 --- a/node_modules/.cache/eslint/7dc60d80.json +++ b/node_modules/.cache/eslint/7dc60d80.json @@ -1 +1 @@ -[{"D:\\love forest\\src\\main.js":"1","D:\\love forest\\src\\App.vue":"2","D:\\love forest\\src\\router\\index.js":"3","D:\\love forest\\src\\views\\Main.vue":"4","D:\\love forest\\src\\views\\login\\login.vue":"5","D:\\love forest\\src\\views\\chat\\chat.vue":"6","D:\\love forest\\src\\views\\community\\trends.vue":"7","D:\\love forest\\src\\views\\recommend\\index.vue":"8","D:\\love forest\\src\\views\\space\\space.vue":"9","D:\\love forest\\src\\components\\header.vue":"10"},{"size":322,"mtime":1731640120422,"results":"11","hashOfConfig":"12"},{"size":263,"mtime":1731640155296,"results":"13","hashOfConfig":"12"},{"size":1052,"mtime":1731600508081,"results":"14","hashOfConfig":"12"},{"size":354,"mtime":1731639809258,"results":"15","hashOfConfig":"12"},{"size":14681,"mtime":1731642268386,"results":"16","hashOfConfig":"12"},{"size":156,"mtime":1731588241061,"results":"17","hashOfConfig":"12"},{"size":155,"mtime":1731588241062,"results":"18","hashOfConfig":"12"},{"size":161,"mtime":1731588241065,"results":"19","hashOfConfig":"12"},{"size":157,"mtime":1731588241067,"results":"20","hashOfConfig":"12"},{"size":2643,"mtime":1731588241055,"results":"21","hashOfConfig":"12"},{"filePath":"22","messages":"23","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"739o3u",{"filePath":"24","messages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"28"},{"filePath":"29","messages":"30","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"31","messages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"33","messages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},{"filePath":"36","messages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},{"filePath":"38","messages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},{"filePath":"40","messages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},{"filePath":"42","messages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"35"},"D:\\love forest\\src\\main.js",[],"D:\\love forest\\src\\App.vue",[],"D:\\love forest\\src\\router\\index.js",[],[],"D:\\love forest\\src\\views\\Main.vue",[],"D:\\love forest\\src\\views\\login\\login.vue",[],"D:\\love forest\\src\\views\\chat\\chat.vue",[],[],"D:\\love forest\\src\\views\\community\\trends.vue",[],"D:\\love forest\\src\\views\\recommend\\index.vue",[],"D:\\love forest\\src\\views\\space\\space.vue",[],"D:\\love forest\\src\\components\\header.vue",[]] \ No newline at end of file +[{"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\main.js":"1","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\App.vue":"2","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\router\\index.js":"3","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\Main.vue":"4","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\components\\header.vue":"5","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\components\\background.vue":"6","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\recommend\\index.vue":"7","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\chat\\chat.vue":"8","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\community\\trends.vue":"9","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\space\\space.vue":"10","D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\login\\login.vue":"11"},{"size":261,"mtime":1731506523733,"results":"12","hashOfConfig":"13"},{"size":97,"mtime":1731506523731,"results":"14","hashOfConfig":"13"},{"size":1052,"mtime":1731513557777,"results":"15","hashOfConfig":"13"},{"size":359,"mtime":1731741182777,"results":"16","hashOfConfig":"13"},{"size":2643,"mtime":1731566073424,"results":"17","hashOfConfig":"13"},{"size":919,"mtime":1731566064122,"results":"18","hashOfConfig":"13"},{"size":161,"mtime":1731508571798,"results":"19","hashOfConfig":"13"},{"size":156,"mtime":1731511731213,"results":"20","hashOfConfig":"13"},{"size":155,"mtime":1731512433247,"results":"21","hashOfConfig":"13"},{"size":157,"mtime":1731512507547,"results":"22","hashOfConfig":"13"},{"size":14422,"mtime":1731741182778,"results":"23","hashOfConfig":"13"},{"filePath":"24","messages":"25","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},"10795if",{"filePath":"27","messages":"28","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"30","messages":"31","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"26"},{"filePath":"32","messages":"33","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"34","messages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"36","messages":"37","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"38","messages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"40","messages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"42","messages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"44","messages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"29"},{"filePath":"46","messages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\main.js",[],[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\App.vue",[],[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\router\\index.js",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\Main.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\components\\header.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\components\\background.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\recommend\\index.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\chat\\chat.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\community\\trends.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\space\\space.vue",[],"D:\\我的桌面\\恋爱森林\\dazuoye\\src\\views\\login\\login.vue",[]] diff --git a/package-lock.json b/package-lock.json index bb53a751..a0b1e76b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,6 @@ "name": "demo", "version": "0.1.0", "dependencies": { - "@element-plus/icons-vue": "^2.3.1", - "animate.css": "^4.1.1", "axios": "^1.7.7", "core-js": "^3.8.3", "element-plus": "^2.8.6", @@ -4349,8 +4347,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "license": "MIT" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/at-least-node": { "version": "1.0.0", @@ -4404,7 +4401,6 @@ "version": "1.7.7", "resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.7.tgz", "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", - "license": "MIT", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -5076,7 +5072,6 @@ "version": "1.0.8", "resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" }, @@ -5926,7 +5921,6 @@ "version": "1.0.0", "resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "license": "MIT", "engines": { "node": ">=0.4.0" } @@ -7281,7 +7275,6 @@ "version": "4.0.1", "resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.1.tgz", "integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==", - "license": "MIT", "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -10573,8 +10566,7 @@ "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "license": "MIT" + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/pseudomap": { "version": "1.0.2", diff --git a/package.json b/package.json index 62f70a66..6e6c1034 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,6 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@element-plus/icons-vue": "^2.3.1", - "animate.css": "^4.1.1", "axios": "^1.7.7", "core-js": "^3.8.3", "element-plus": "^2.8.6", diff --git a/src/App.vue b/src/App.vue index a4de4c80..837c15cf 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,11 +4,17 @@ - diff --git a/src/assets/css/login/login.css b/src/assets/css/login/login.css new file mode 100644 index 00000000..50505fe4 --- /dev/null +++ b/src/assets/css/login/login.css @@ -0,0 +1,147 @@ +.base{ + height: 100vh; + display: flex; + justify-content: center; + align-items: center; + background-image: url("@/assets/pictures/background.png"); + background-size: 100%; +} +.loginAndRegist{ + position: absolute; + display: flex; + justify-content: center; + align-items: center; + overflow: hidden; + right:6%; + top:35%; + + +} +.loginArea{ + background-color: rgba(255,255,255,0.8); + opacity: 0.8; + border-top-left-radius: 15px; + border-bottom-left-radius: 15px; + height: 400px; + width: 400px; + z-index: 1; + display: flex; + flex-direction: column; + align-items: center; + overflow: hidden; +} +.registArea{ + opacity: 0.8; + border-top-right-radius: 15px; + border-bottom-right-radius: 15px; + height: 400px; + width: 400px; + background-color: rgba(255,255,255,0.8); + z-index: 1; + display: flex; + flex-direction: column; + justify-content:center ; + align-items: center; +} +.showInfo{ + border-top-right-radius: 15px; + border-bottom-right-radius: 15px; + position: absolute; + height: 400px; + width: 400px; + z-index:2; + top: 0; + right: 0; + background-image: url("@/assets/pictures/welcome.png"); + background-size: 90%; +} +.showInfo:hover{ + background-size: 100%; + background-position: -50px -50px; +} +.title{ + width: 80%; + flex:1; + border-bottom: 1px solid #E44B9D; + display: flex; + align-items: center; + color: #E44B9D; + font-weight: bold; + font-size: 24px; + display: flex; + justify-content: center; +} +#aaa{ + transition: 0.3s linear; +} +.pwdArea{ + width: 100%; + flex:2; + display: flex; + flex-direction: column; + color: #E44B9D; + font-size: 20px; + font-weight: bold; +} +.pwdArea input{ + height: 30px; + border-radius:15px ; + padding-left: 10px; + font-size: 13px; +} +/* 移除输入框边框 */ +.el-input__inner { + border: none !important; + outline: none !important; +} + +.pwdArea input:focus{ + border: 2px solid #E44B9D; +} + .btnArea{ + flex:1; + width: 100%; + display: flex; + justify-content: space-around; + align-items: center; + } + .rigestTitle{ + width: 70%; + flex: 1; + color: #E44B9D; + font-weight: bold; + font-size: 24px; + display: flex; + justify-content: center; + align-items: center; + border-bottom: 1px solid #E44B9D; + } + .registForm{ + flex: 2; + display: flex; + flex-direction: column; + color: #E44B9D; + font-size: 20px; + font-weight: bold; + } + + .registForm input{ + outline: none; + height: 30px; + border-radius:13px ; + padding-left: 10px; + font-size: 12px; + border: 1px solid gray; + } +.registForm input:focus{ + border: 2px solid #E44B9D; +} +#elselect:focus{ + border: 2px solid #E44B9D; +} + .registBtn{ + flex: 1; + display: flex; + justify-content: center; + align-items: center; + } \ No newline at end of file diff --git a/src/token/auth.js b/src/token/auth.js new file mode 100644 index 00000000..56c35e6f --- /dev/null +++ b/src/token/auth.js @@ -0,0 +1,18 @@ +// 存储、获取、删除token的文件 +// 定义 setToken 函数,用于将 token 存储到 localStorage +export function setToken(token) { + localStorage.setItem('authToken', token); + } + + // 定义 getToken 函数,用于从 localStorage 获取 token +export function getToken() { + return localStorage.getItem('authToken'); + } + + // 定义 removeToken 函数,用于从 localStorage 删除 token +export function removeToken() { + localStorage.removeItem('authToken'); + } + + + \ No newline at end of file diff --git a/src/utils/axiosConfig.js b/src/utils/axiosConfig.js new file mode 100644 index 00000000..a97b4bd8 --- /dev/null +++ b/src/utils/axiosConfig.js @@ -0,0 +1,64 @@ +// axiosConfig.js +import axios from 'axios'; +import {getToken} from '@/token/auth' // 注意这里使用了解构赋值来导入getToken函数 + +// 创建axios实例 +const service = axios.create({ + baseURL: 'http://47.122.59.26:8080/api', // 配置基础URL + timeout: 5000, // 请求超时时间 +}); + +// 请求拦截器 +service.interceptors.request.use( + config => { + // 在发送请求之前做些什么 + const token = getToken(); // 获取token的方式取决于你的应用 + // console.log('请求拦截器的token是:' +token) + console.log('Request Config:', config); + if (token) { + config.headers['Authorization'] = `Bearer ${token}`; // 设置token + // axios.defaults.headers.common['Authorization'] = 'Bearer ' + token; + } + config.headers['Accept'] = 'application/json'; + return config; + }, + error => { + // 对请求错误做些什么 + console.error('Request Error:', error); + return Promise.reject(error); + } +); + +// 响应拦截器 +service.interceptors.response.use( + response => { + // 对响应数据做点什么 + // !!!注意!!!这里返回已经包含data + const res = response.data; + // 你可以根据实际情况在这里添加一些通用的响应处理逻辑 + // 例如,根据返回的状态码判断请求是否成功 + // if (res.code !== 200) { + // 业务错误处理,比如弹窗提示等 + // return Promise.reject(new Error(res.message || 'Error')); + // } else { + return res; + // } + }, + error => { + // 对响应错误做点什么 + // if (error.response) { + // 请求已发出,但服务器响应的状态码不在2xx的范围 + // console.error('Error status:', error.response.status); + // console.error('Error data:', error.response.data); + // } else if (error.request) { + // 请求已发出,但没有收到响应 + // console.error('Error request:', error.request); + // } else { + // 在设置请求时触发错误 + console.error('响应拦截器errorMessage:', error.message); + // } + return Promise.reject(error); + } +); + +export default service; \ No newline at end of file diff --git a/src/views/login/login.vue b/src/views/login/login.vue index 9056f7a6..d1eb6765 100644 --- a/src/views/login/login.vue +++ b/src/views/login/login.vue @@ -33,7 +33,7 @@
验   证   码:     - + 假验证码
@@ -98,8 +98,8 @@
验   证   码: - - 假验证码 + + 假验证码
@@ -170,174 +170,23 @@ - - - + \ No newline at end of file + + + \ No newline at end of file