Skip to content

Commit 92307cd

Browse files
committed
Solve the ReferenceError
1 parent 7e99885 commit 92307cd

File tree

4 files changed

+46
-25
lines changed

4 files changed

+46
-25
lines changed

code/Readme.md

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,67 @@
11
This folder contains all source code and test code.
2+
23
## How to Run?
34

45
### 1. Frontend
6+
57
```
68
cd code/frontend
79
```
10+
811
#### 1.1 Make sure you have npm or node installed.
12+
913
```
10-
npm -v
14+
npm -v
1115
node -v
1216
```
17+
1318
#### 1.2 Install all the dependencies
19+
1420
```
1521
npm install
1622
```
1723

1824
#### 1.3 Start the front-end App
25+
1926
```
20-
export NODE_OPTIONS=--openssl-legacy-provider
27+
export NODE_OPTIONS=--openssl-legacy-provider
2128
npm run serve
2229
```
2330

2431
#### 1.4 Open your browser
32+
2533
```
2634
http://localhost:8080
2735
```
2836

2937
#### 1.5 Compile and Build dist. (Production only)
38+
3039
```
3140
npm run build
3241
```
42+
3343
> The Compiled files under: ./dist
3444
45+
### 2. Copy Front-end App to Backend (CORS)
3546

36-
### 2. Copy Fron-end App to Backend (CORS)
3747
```
3848
cp -r ./dist/* ../backend/src/main/resource/static/
3949
```
4050

4151
### 3. Backend
42-
> Prerequisite:
43-
- Database creation required.
44-
- JDK
45-
- Maven
52+
53+
> Prerequisite:
54+
55+
- Database creation required.
56+
- JDK
57+
- Maven
4658

4759
#### 3.1 Use any IDE to open the code:
4860

4961
Here, we recommend **IntelliJ IDEA**
5062

5163
#### 3.1 Use any IDE for your Development:
64+
5265
```
5366
cd backend
5467
@@ -58,20 +71,24 @@ mvn clean install -DskipTests
5871
#### 3.2 Start Spring Boot Application (For Dev.)
5972

6073
> Main Class:
74+
6175
```
62-
edu.bu.cs673.secondhand.Application
76+
edu.bu.cs673.secondhand.Application
6377
```
6478

6579
#### 3.3 Compile (For Prod.)
80+
6681
```
6782
mvn clean package -DskipTests
6883
```
84+
6985
> Note: The compiled Jar be under: src/main/resource/bu-secondhand-1.0.0.jar
7086
> **Download Our snapshot**: [Download](https://drive.google.com/file/d/1MGHmqFn9JVJDV9i4CGHPK_WyYMrfZ3wQ/view?usp=sharing)
7187
72-
7388
#### 3.4 Deploy and Run (For Prod.)
89+
7490
```
7591
java -jar bu-secondhand-1.0.0.jar
7692
```
77-
> Open Browser: http://localhost:8080
93+
94+
> Open Browser: http://localhost:8080

code/frontend/src/components/page/me.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div>
33
<app-head :nickname-value="userInfo.nickname" :avatarValue="userInfo.avatar"></app-head>
44
<app-body>
5-
<div v-show="!editAddress">
5+
<div v-show="!eidtAddress">
66
<div class="user-info-container">
77
<div class="user-info-details">
88
<el-upload
@@ -60,7 +60,7 @@
6060
</div>
6161
</div>
6262
<div class="user-info-space">
63-
<el-button type="primary" plain @click="editAddress = true">Edit Address</el-button>
63+
<el-button type="primary" plain @click="eidtAddress = true">Edit Address</el-button>
6464
</div>
6565
</div>
6666
<div class="idle-container">
@@ -106,8 +106,8 @@
106106
</div>
107107
</div>
108108
</div>
109-
<div v-show="editAddress" class="address-container">
110-
<el-page-header class="address-container-back" @back="editAddress = false" content="Delivery Address"></el-page-header>
109+
<div v-show="eidtAddress" class="address-container">
110+
<el-page-header class="address-container-back" @back="eidtAddress = false" content="Delivery Address"></el-page-header>
111111
<div class="address-container-add">
112112
<div class="address-container-add-title">Add New Address</div>
113113
<div class="address-container-add-item">
@@ -181,7 +181,7 @@
181181
import AppHead from '../common/AppHeader.vue';
182182
import AppBody from '../common/AppPageBody.vue';
183183
import AppFoot from '../common/AppFoot.vue';
184-
// import options from '../common/country-data.js';
184+
import options from '../common/country-data.js';
185185
186186
export default {
187187
name: 'me',
@@ -212,7 +212,7 @@ export default {
212212
userPassword1: '',
213213
userPassword2: '',
214214
userPassword3: '',
215-
editAddress: false,
215+
eidtAddress: false,
216216
selectedOptions: [], // Store default values
217217
options: options, // Store city data
218218
userInfo: {

code/frontend/src/utils/request.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,25 @@ import axios from 'axios';
55
*
66
* @author Yingtong Zhou
77
*
8+
* Date: 2024/11/3
89
*/
910

1011
const service = axios.create({
1112
timeout: 5000,
1213
baseURL: 'http://8.221.118.240:8080',
13-
withCredentials: true
14+
withCredentials: true,
15+
timeoutErrorMessage: 'The request took too long, please try again later.'
1416
});
1517

1618
// request interceptor
1719
service.interceptors.request.use(
1820
(config) => {
21+
console.log('Request URL:', config.baseURL + config.url);
22+
console.log('Request Data:', config.data);
1923
return config;
2024
},
2125
(error) => {
22-
console.log(error);
26+
console.log('Request Error:', error);
2327
return Promise.reject();
2428
}
2529
);
@@ -34,7 +38,7 @@ service.interceptors.response.use(
3438
}
3539
},
3640
(error) => {
37-
console.log(error);
41+
console.log('Response Error:', error);
3842
return Promise.reject();
3943
}
4044
);

code/frontend/vue.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const webpack = require('webpack')
1+
const webpack = require('webpack');
22

33
module.exports = {
44
publicPath: './',
@@ -7,15 +7,15 @@ module.exports = {
77
configureWebpack: {
88
plugins: [
99
new webpack.ProvidePlugin({
10-
$: "jquery",
11-
jQuery: "jquery",
12-
"windows.jQuery": "jquery"
10+
$: 'jquery',
11+
jQuery: 'jquery',
12+
'windows.jQuery': 'jquery'
1313
})
1414
]
1515
},
1616
devServer: {
17-
port: 8080,
18-
},
17+
port: 8080
18+
}
1919
// devServer: {
2020
// proxy: {
2121
// '/api':{

0 commit comments

Comments
 (0)