Compare commits

...

65 Commits

Author SHA1 Message Date
mafc2zqui 854d42a0de ADD file via upload
1 year ago
zcx 26b60acc17 Squashed commit of the following:
1 year ago
zcx 123fb36b7a Squashed commit of the following:
1 year ago
zcx 0f844484d9 Squashed commit of the following:
1 year ago
zcx a0642f1797 Squashed commit of the following:
1 year ago
zcx 7d34478c1d 1
1 year ago
zcx 9350aac4d9 修改上传文件结构
1 year ago
“fangxiaoting” 3362abb2f7 Merge branch 'develop' into fangxiaoting_branch
1 year ago
“fangxiaoting” b7d8754406 1
1 year ago
“fangxiaoting” 39951be00e Merge branch 'develop' into fangxiaoting_branch
1 year ago
“fangxiaoting” 6a7287fb4b Squashed commit of the following:
1 year ago
“fangxiaoting” 0bd73e8716 1
1 year ago
zhanglinhao 06ae856043 合并分支
1 year ago
zcx ba80d18ee0 Squashed commit of the following:
1 year ago
zcx aed55f5ff8 修改文件结构
1 year ago
zcx 093ac28300 Squashed commit of the following:
1 year ago
zcx 5770cc6dd5 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into develop
1 year ago
zcx a8191418b4 Squashed commit of the following:
1 year ago
zhanglinhao e14c3ccc0c Squashed commit of the following:
1 year ago
mwxbgi697 0d739d8a5a Merge pull request '发送需求' (#10) from wuyifan_branch into develop
1 year ago
wyf 07afa9091a 修改
1 year ago
mwxbgi697 1676bb1968 Merge pull request '后端代码新增' (#9) from wuyifan_branch into develop
1 year ago
wyf ef00c925dd 新增后端代码
1 year ago
wyf 417422d127 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into wuyifan_branch
1 year ago
zhanglinhao 63b04cda77 Squashed commit of the following:
1 year ago
zhanglinhao aa91faa3df 优化后端代码存储结构
1 year ago
zcx d73c814619 Squashed commit of the following:
1 year ago
zcx 3f241a6a46 1
1 year ago
zcx ecd56eeb36 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch
1 year ago
zcx 55dbf59cb1 修改文件
1 year ago
zcx f745de4fef Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch
1 year ago
zcx c82f1efc8c 修改文件位置
1 year ago
zcx 682f31b015 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into develop
1 year ago
mwxbgi697 6e9bf8e012 Merge pull request '更新后端代码' (#8) from zhanglinhao_branch into develop
1 year ago
zhanglinhao 2e1475fb0a 更新后端代码
1 year ago
zhanglinhao 7f854cff83 Merge branch 'develop' of bdgit.educoder.net:mwxbgi697/softegg into zhanglinhao_branch
1 year ago
zhanglinhao b89bbc7124 格式化仓库
1 year ago
zhanglinhao f710dc84ed 优化仓库储存结构
1 year ago
zhanglinhao 3e2ec298a3 优化仓库结构
1 year ago
zcx 1767a27da7 Squashed commit of the following:
1 year ago
zcx d83686a012 新界面
1 year ago
zcx 1e9c7ee52d 删除多余文件
1 year ago
zcx f0eb9cae7e Squashed commit of the following:
1 year ago
zcx 977b40cd4f 新的页面代码
1 year ago
zcx f6fc54bb2a Squashed commit of the following:
1 year ago
zcx 548cc49c7d 聊天界面初始版
1 year ago
zcx ff3952859f Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch
1 year ago
zcx 7b44e8a348 1
1 year ago
zcx 5e48c1f463 Merge branch '曾晨曦_branch' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch
1 year ago
zcx 167bb2d273 前端代码初始版
1 year ago
zcx c6568564ce 1
1 year ago
“fangxiaoting” 1b382b341f 上传前端代码
1 year ago
zcx e5d3488734 更新
1 year ago
wyf 83ecb0ff15 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into wuyifan_branch
1 year ago
wyf 5502fbfc11 Merge branch 'master' of https://bdgit.educoder.net/mwxbgi697/softegg into wuyifan_branch
1 year ago
wyf 309f6806a3 将用户注册和登录作了是否区分游客与导游两种情况
1 year ago
wyf c63bc3bc5b 用户注册、登录的顺序图
1 year ago
wyf 7d61ee5b91 修改
1 year ago
wyf cb9e75bb11 需求构思补了部署图,规格说明书写了第二大点
1 year ago
wyf 616cd32933 修改模板
1 year ago
wyf 1de1cccf80 对需求规格说明书第二大点进行修改
1 year ago
zcx bfb34b10a2 需求规格说明书
1 year ago
zcx 26f7946e45 1
1 year ago
zcx 31f1339042 Merge branch 'develop' of https://bdgit.educoder.net/mwxbgi697/softegg into 曾晨曦_branch
1 year ago
zcx 36717942eb 用例图
1 year ago

Binary file not shown.

Before

Width:  |  Height:  |  Size: 270 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 810 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 745 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 760 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

@ -0,0 +1,68 @@
<template>
<div>订单号: {{ orderId }}</div>
<div v-for="(service, index) in services" :key="service.gid" class="service-box">
<p>{{ service.nickname }}</p>
<p>{{ service.endDate }}</p>
<!-- 添加一个按钮并绑定 click 事件处理器 sendServiceId -->
<button @click="sendServiceId(service.gid)"></button>
</div>
</template>
<script>
import axios from 'axios';
export default {
props: ['orderId'],
data() {
return {
services: []
};
},
methods: {
async sendServiceId(gid) {
try {
// APIgiddidPOST
const orderIdAsInt = parseInt(this.orderId, 10);
const gidAsInt = parseInt(gid, 10);
const response = await axios.post('http://192.168.243.35:9000/DemandMatch/confirmed', { did:orderIdAsInt,gid:gidAsInt});
alert('已同意');
} catch (error) {
console.error('Error sending service ID and order ID:', error);
}
}
},
async created() {
//
axios.get(`http://192.168.243.35:9000/DemandMatch/confirmedPage?did=${this.orderId}`)
.then(response => {
this.services = response.data
})
.catch(error => {
console.error('Error fetching user:', error);
});
},
};
</script>
<style scoped>
/* 样式代码,定义 .service-box 的样式 */
/* 为按钮添加一些样式 */
.service-box button {
margin-left: auto; /* 将按钮推到右侧 */
}
/* 为按钮添加一些样式 */
.service-box button {
margin-left: auto; /* 将按钮推到右侧 */
}
.service-box {
border: 1px solid #ccc;
padding: 10px;
margin-bottom: 10px;
/* 其他样式 */
}
</style>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/walktofree" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -1,30 +0,0 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
.DS_Store
dist
dist-ssr
coverage
*.local
/cypress/videos/
/cypress/screenshots/
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.tsbuildinfo

@ -1,3 +0,0 @@
{
"recommendations": ["Vue.volar"]
}

@ -1,29 +0,0 @@
# walktofree
This template should help get you started developing with Vue 3 in Vite.
## Recommended IDE Setup
[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur).
## Customize configuration
See [Vite Configuration Reference](https://vitejs.dev/config/).
## Project Setup
```sh
npm install
```
### Compile and Hot-Reload for Development
```sh
npm run dev
```
### Compile and Minify for Production
```sh
npm run build
```

@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

@ -1,8 +0,0 @@
{
"compilerOptions": {
"paths": {
"@/*": ["./src/*"]
}
},
"exclude": ["node_modules", "dist"]
}

File diff suppressed because it is too large Load Diff

@ -1,21 +0,0 @@
{
"name": "walktofree",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"axios": "^1.6.8",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.0.4",
"@vue/cli-service": "^5.0.8",
"vite": "^5.2.8"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

@ -8,6 +8,7 @@
export default { export default {
name: 'App' name: 'App'
} }
</script> </script>
<style> <style>

@ -1,6 +1,6 @@
import axios from 'axios' import axios from 'axios'
const baseURL = '192.168.254.35:8080' const baseURL = 'https:106.52.218.118:12607'
export const login = (data) => { export const login = (data) => {
return axios.post(`${baseURL}/Login/login`, data) return axios.post(`${baseURL}/Login/login`, data)

@ -0,0 +1,16 @@
<template>
<div>
<label for="user-input"></label>
<input type="text" id="user-input" v-model="userInput" placeholder="请输入">
</div>
</template>
<script>
export default {
data() {
return {
userInput: '', //
};
},
};
</script>

@ -0,0 +1,68 @@
<template>
<div class="footer-nav">
<div class="button-with-icon" @click="gotohome()">
<el-icon><House /></el-icon>
<span>首页</span>
</div>
<div class="button-with-icon" @click="gotomessage()()">
<el-icon><ChatDotSquare /></el-icon>
<span>消息</span>
</div>
<div class="button-with-icon" @click="gotomine()">
<el-icon><User /></el-icon>
<span>我的</span>
</div>
</div>
</template>
<script>
export default {
name: 'Home',
methods: {
gotohome() {
this.$router.push('/home');
},
gotomessage() {
this.$router.push('/message');
},
gotomine() {
this.$router.push('/mine');
},
gotoSearchPage() {
this.$router.push('/searchPage');
},
gotoAddDemandPage() {
this.$router.push('/addDemandPage');
},
}
}
</script>
<style>
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.button-with-icon {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>

@ -0,0 +1,70 @@
<template>
<el-button plain class="addServe-button" @click="isGuide()">
我是导游
</el-button>
<el-dialog
v-model="dialogVisible"
width="500"
>
<span>您还不是导游是否申请平台导游资格</span>
<template #footer>
<div class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="gotoRegisterGuide">
申请
</el-button>
</div>
</template>
</el-dialog>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
import axios from 'axios';
const router = useRouter();
const dialogVisible = ref(false)
const gotoRegisterGuide = () => {
router.push('/registerGuide')
}
const isGuide = () => {
axios.get(`http://106.52.218.118:8081/users/isGuide?phone=${sessionStorage.getItem('phone')}`)
.then(response => {
if (response.data == true){
router.push('/addServe')
}
else{
dialogVisible.value = true;
}
})
.catch(error => {
console.error('Error fetching user:', error);
});
}
</script>
<style>
.addServe-button {
/* 定义返回按钮的样式 */
position: fixed; /* 使按钮位置固定 */
top: 10px;
right: 10px;
margin: 0;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.addServe-button:hover {
background-color: #aaaaaa;
}
</style>

@ -1,67 +0,0 @@
<template>
<div class="home-container">
<h1>消息页面</h1>
<!-- 在这里添加你的主页内容 -->
<div class="footer-nav">
<button @click="gotohome()"></button>
<button @click="gotomessage()"></button>
<button @click="gotomine()"></button>
</div>
</div>
</template>
<style scoped>
.home-container {
/* 添加你的样式 */
text-align: center;
padding: 20px;
/* 可能需要为内容添加一些底部空间以容纳底部导航 */
padding-bottom: 50px;
}
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.footer-nav button {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>
<script>
export default {
name: 'Message',
methods: {
gotohome() {
this.$router.push('/home');
},
gotomessage() {
this.$router.push('/message');
},
gotomine() {
this.$router.push('/mine');
},
}
}
</script>

@ -1,339 +1,45 @@
<template> <script setup lang="ts">
<div class="mine"> import { ref, watchEffect } from 'vue'
<h2>个人主页</h2> import { format } from 'date-fns'
<h1>{{ user.name }}</h1> const startDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
<!-- <h1>用户姓名</h1>--> const endDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
<p>创建时间{{user.createtime}}</p> watchEffect(() => {
<p>账号: {{ username }}</p> console.log('startDateValue:', startDateValue.value)
<p>身份证号{{user.IDCard}}</p> console.log('endDateValue:', endDateValue.value)
<div v-if="showEmailInput"> })
<label for="email">邮箱</label> </script>
<input type="email" id="email" v-model="email" class="input-field">
<button @click="updateEmail"></button>
</div>
<div v-else>
<p>邮箱{{ user.email }}</p>
<button @click="toggleEmailInput"></button>
</div>
<div v-if="showPhoneInput">
<label for="PhoneNumber">手机号</label>
<input type="phone" id="phone" v-model="phone" class="input-field">
<button @click="updatePhone"></button>
</div>
<div v-else>
<p>手机号{{ user.phone }}</p>
<button @click="togglePhoneInput"></button>
</div>
<div class="footer-nav">
<button @click="gotohome()"></button>
<button @click="gotomessage()"></button>
<button>我的</button>
</div>
</div>
</template>
<style scoped>
.profile {
max-width: 400px;
margin: 0 auto;
padding: 20px;
}
.input-field {
margin-bottom: 10px;
}
button {
margin-top: 10px;
}
.home-container {
/* 添加你的样式 */
text-align: center;
padding: 20px;
/* 可能需要为内容添加一些底部空间以容纳底部导航 */
padding-bottom: 50px;
}
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.footer-nav button {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>
<script>
import { ref, onMounted } from 'vue';
// 使AxiosHTTP
import axios from 'axios';
export default {
name: 'Mine',
props: ['username'],
setup(props) {
const user = ref({}); // 使refdata
const email = ref('');
const showEmailInput = ref(false);
const phone = ref('');
const showPhoneInput = ref(false);
// 使onMountedcreated
onMounted(() => {
fetchUser(props.username);
});
// fetchUser使Axios
async function fetchUser(username) {
try {
const response = await axios.get(`/api/users/${username}`);
user.value = response.data; // user
} catch (error) {
console.error('Error fetching user:', error);
}
}
//
function gotohome() {
router.push('/home');
}
function gotomessage() {
router.push('/message');
}
fetchUser(username) {
// API
axios.post(`http://192.168.254.35:8080/user/${username}`)
.then(response => {
this.user = response.data;
})
.catch(error => {
console.error('Error fetching user:', error);
});
},
toggleEmailInput() {
this.showEmailInput = !this.showEmailInput;
this.email = this.user.email;//
},
updateEmail() {
//
axios.put(`http://192.168.254.35:8080/user/${this.username}/email`, { email: this.email })
.then(response => {
alert(this.email);
this.user.email = this.email;
this.toggleEmailInput(); //
})
.catch(error => {
console.error('Error updating email:', error);
});
},
togglePhoneInput(){
this.showPhoneInput = !this.showPhoneInput;
this.phone = this.user.phone;
},
updatePhone(){
axios.put(`http://192.168.254.35:8080/user/${this.username}/phone`, { phone: this.phone })
.then(response => {
this.user.phone = this.phone;
this.togglePhoneInput(); //
})
.catch(error => {
console.error('Error updating phone:', error);
});
}
return {
user,
email,
showEmailInput,
phone,
showPhoneInput,
gotohome,
gotomessage,
};
},
};
</script>
<template> <template>
<div class="mine"> <VueDatePicker
<h2>个人主页</h2> placeholder="请选择预计出发日期"
<h1>{{ user.name }}</h1> :min-date="new Date()"
<!-- <h1>用户姓名</h1>--> format="yyyy-MM-dd"
<p>创建时间{{user.createtime}}</p> v-model="startDateValue" />
<p>账号: {{ username }}</p> <VueDatePicker
<p>身份证号{{user.IDCard}}</p> placeholder="请选择预计返回日期"
<div v-if="showEmailInput"> :min-date="new Date()"
<label for="email">邮箱</label> format="yyyy-MM-dd"
<input type="email" id="email" v-model="email" class="input-field"> v-model="endDateValue" />
<button @click="updateEmail"></button>
</div>
<div v-else>
<p>邮箱{{ user.email }}</p>
<button @click="toggleEmailInput"></button>
</div>
<div v-if="showPhoneInput">
<label for="PhoneNumber">手机号</label>
<input type="phone" id="phone" v-model="phone" class="input-field">
<button @click="updatePhone"></button>
</div>
<div v-else>
<p>手机号{{ user.phone }}</p>
<button @click="togglePhoneInput"></button>
</div>
<div class="footer-nav">
<button @click="gotohome()"></button>
<button @click="gotomessage()"></button>
<button>我的</button>
</div>
</div>
</template> </template>
<script setup lang="ts">
<style scoped> import { ref, watchEffect } from 'vue'
.profile { import { format } from 'date-fns'
max-width: 400px; const startDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
margin: 0 auto; const endDateValue = ref(format(new Date(), 'yyyy-MM-dd'))
padding: 20px; watchEffect(() => {
} console.log('startDateValue:', startDateValue.value)
console.log('endDateValue:', endDateValue.value)
.input-field { })
margin-bottom: 10px; </script>
} <template>
<VueDatePicker
button { placeholder="请选择预计出发日期"
margin-top: 10px; :min-date="new Date()"
} format="yyyy-MM-dd"
v-model="startDateValue" />
.home-container { <VueDatePicker
/* 添加你的样式 */ placeholder="请选择预计返回日期"
text-align: center; :min-date="new Date()"
padding: 20px; format="yyyy-MM-dd"
/* 可能需要为内容添加一些底部空间以容纳底部导航 */ v-model="endDateValue" />
padding-bottom: 50px; </template>
}
.footer-nav {
/* 定义底部导航的样式 */
position: fixed;
bottom: 0;
left: 0;
right: 0;
display: flex;
justify-content: space-around;
padding: 10px;
background-color: #f5f5f5; /* 示例背景色 */
}
.footer-nav button {
/* 定义按钮的样式 */
flex: 1;
border: none;
padding: 10px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button:hover {
/* 按钮点击时的样式 */
background-color: #bbb;
}
</style>
<script>
export default {
name: 'Mine',
props: ['username'],
data() {
return {
user: {}, //
email: '',
showEmailInput: false,
phone: '',
showPhoneInput: false,
};
},
created() {
this.fetchUser(this.username);
},
methods: {
gotohome() {
this.$router.push('/home');
},
gotomessage() {
this.$router.push('/message');
},
fetchUser(username) {
// API
axios.post(`http://192.168.254.35:8080/user/${username}`)
.then(response => {
this.user = response.data;
})
.catch(error => {
console.error('Error fetching user:', error);
});
},
toggleEmailInput() {
this.showEmailInput = !this.showEmailInput;
this.email = this.user.email;//
},
updateEmail() {
//
axios.put(`http://192.168.254.35:8080/user/${this.username}/email`, { email: this.email })
.then(response => {
this.user.email = this.email;
this.toggleEmailInput(); //
})
.catch(error => {
console.error('Error updating email:', error);
});
},
togglePhoneInput(){
this.showPhoneInput = !this.showPhoneInput;
this.phone = this.user.phone;
},
updatePhone(){
axios.put(`http://192.168.254.35:8080/user/${this.username}/phone`, { phone: this.phone })
.then(response => {
this.user.phone = this.phone;
this.togglePhoneInput(); //
})
.catch(error => {
console.error('Error updating phone:', error);
});
}
}
}
</script>

@ -0,0 +1,28 @@
<script>
export default {
name: 'return',
methods: {
gotohome() {
this.$router.push('/home');
},
}
}
</script>
<template>
<div class="return">
<button class="return-button" @click="gotohome()"></button>
</div>
</template>
<style>.return-button {
/* 定义返回按钮的样式 */
position: fixed; /* 使按钮位置固定 */
top: 10px;
left: 10px;
margin: 0;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #ccc;
color: #333;
cursor: pointer;
} </style>

@ -0,0 +1,6 @@
export type AreaList = {
code: string;
level: number;
name: string;
areaList: AreaList[];
};

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 787 KiB

After

Width:  |  Height:  |  Size: 787 KiB

@ -1,9 +1,13 @@
import { createApp } from 'vue'; import { createApp } from 'vue';
import App from './App.vue'; import App from './App.vue';
import router from './router'; import router from './router';
import ElementPlus from 'element-plus';
import 'element-plus/theme-chalk/index.css';
import VueDatePicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';
const app = createApp(App); const app = createApp(App);
app.use(ElementPlus);
app.use(router); app.use(router);
app.component('VueDatePicker', VueDatePicker);
app.mount('#app'); app.mount('#app');

@ -0,0 +1,127 @@
<template>
<div class="chat-container">
<div class="chat">
<h2 class="title">聊天室</h2>
<div class="chat-box">
<div v-for="(message, index) in messages" :key="index" class="message">
<span class="sender">{{ message.sender }}</span>
<span class="content">{{ message.content }}</span>
</div>
</div>
<div class="input">
<input type="text" v-model="newMessage" @keyup.enter="sendMessage" placeholder="输入消息...">
<button @click="sendMessage"></button>
</div>
</div>
</div>
<div><NavigationBar /></div>
</template>
<script>
import axios from 'axios';
import NavigationBar from '../components/NavigationBar.vue';
export default {
data() {
return {
messages: [],
newMessage: '',
};
},
components: {
NavigationBar
},
methods: {
async fetchMessages() {
try {
const response = await axios.get('http://example.com/messages');
this.messages = response.data;
} catch (error) {
console.error('Error fetching messages:', error);
}
},
async sendMessage() {
try {
await axios.post('http://example.com/messages', {
content: this.newMessage,
sender: 'Me', // You can replace 'Me' with the sender's name
});
this.newMessage = ''; // Clear the input field after sending
// You might want to fetch messages again here to update the UI with the latest messages
} catch (error) {
console.error('Error sending message:', error);
}
},
// WebSocket logic to receive messages
setupWebSocket() {
const ws = new WebSocket('ws://example.com/socket');
ws.onmessage = (event) => {
const message = JSON.parse(event.data);
this.messages.push(message);
};
},
},
created() {
this.fetchMessages(); // Fetch messages when the component is created
this.setupWebSocket(); // Setup WebSocket connection
},
};
</script>
<style>
.chat-container {
max-width: 600px;
margin: 0 auto;
}
.chat {
border: 2px solid #28a7a3;
border-radius: 10px;
padding: 20px;
display: flex;
flex-direction: column;
height: 100%; /* Ensure the chat box takes up the entire height */
}
.title {
margin-top: 0;
}
.chat-box {
flex: 1; /* Allow the chat box to grow and take up remaining space */
max-height: 300px;
overflow-y: auto;
}
.message {
margin-bottom: 10px;
}
.input {
display: flex;
margin-top: 10px;
}
.input input {
flex: 1;
padding: 8px;
border: 1px solid #003f3f;
border-radius: 5px;
font-size: 16px;
}
.input button {
padding: 8px 15px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: #a6b2ee;
font-size: 16px;
cursor: pointer;
margin-left: 10px;
}
.input button:hover {
background-color: #0056b3;
}
</style>

@ -0,0 +1,41 @@
<template>
<div>
<h1>任务列表</h1>
<div v-for="task in tasks" :key="task.id" class="task-item">
<div>{{ task.title }}</div>
<div>{{ task.description }}</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
tasks: []
};
},
mounted() {
this.fetchTasks();
},
methods: {
async fetchTasks() {
try {
const response = await fetch('http://localhost:3000/tasks');
const data = await response.json();
this.tasks = data;
} catch (error) {
console.error(error);
}
}
}
};
</script>
<style>
.task-item {
border: 1px solid #ccc;
padding: 10px;
margin: 10px 0;
}
</style>

@ -0,0 +1,103 @@
<template>
<div class="user-feedback">
<!-- 输入评价 -->
<div class="feedback-input">
<h2>写下你的评价吧</h2>
<form>
<textarea id="ebody" v-model.trim="ebody" rows="4" cols="50" placeholder="在这里输入您的评价"></textarea>
<button type="submit" @click="send"></button>
</form>
</div>
<el-space direction="vertical">
<el-row>
<el-text>星级评价</el-text>
<el-rate class="ml-1"
v-model="satisfaction"
:texts="['oops', 'disappointed', 'normal', 'good', 'great']"
show-text
@change="handleRateChange"
clearable />
</el-row>
</el-space>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
user: {},
eid: '',
ebody: '',
satisfaction:'',
};
},
methods: {
send() {
axios.post('http://106.52.218.118:12607/evaluate/addEvaluation', {
eid : 1,
satisfaction :this.satisfaction,
ebody :this.ebody,
}, {
// cookie
withCredentials: true,
// JSON
headers: {
'Content-Type': 'application/json'
}
})
},
handleRateChange(){
this.satisfaction = satisfaction; //
}
}
};
</script>
<style scoped>
.user-feedback {
max-width: 600px;
margin: 0 auto;
}
.feedback-input {
margin-bottom: 20px;
}
textarea {
width: 100%;
padding: 8px;
font-size: 16px;
border: 1px solid #28a7a3;
border-radius: 4px;
margin-bottom: 10px;
}
button {
padding: 8px 16px;
font-size: 16px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #003f3f;
cursor: pointer;
}
.submitted-feedback {
border-top: 1px solid #a6cfee;
padding-top: 20px;
}
.feedback-item {
background-color: #abd4ee;
border: 1px solid #c2f1fb;
border-radius: 4px;
padding: 10px;
}
.feedback-item p {
margin: 0;
}
</style>

@ -0,0 +1,121 @@
<template>
<div class="user-feedback">
<!-- 输入评价 -->
<div class="feedback-input">
<h2>修改你的评价</h2>
<form>
<textarea id="ebody" v-model.trim="evaluation.ebody" rows="4" cols="50"></textarea>
<button type="submit" @click="send"></button>
</form>
</div>
<el-space direction="vertical">
<el-row>
<el-text>星级评价</el-text>
<el-rate class="ml-1"
v-model="evaluation.satisfaction"
:texts="['oops', 'disappointed', 'normal', 'good', 'great']"
show-text
@change="handleRateChange"
clearable />
</el-row>
</el-space>
</div>
</template>
<script>
import axios from 'axios';
export default {
data() {
return {
ebody: '',
satisfaction:'',
ct:'',
eid: 1, // eid
evaluation: {}, //
};
},
methods: {
send() {
axios.post('http://106.52.218.118:8081/evaluate/editEvaluation', {
eid: this.eid, // eid
satisfaction: this.evaluation.satisfaction,
ct:this.evaluation.ct,
ebody: this.evaluation.ebody,
}, {
withCredentials: true,
headers: {
'Content-Type': 'application/json'
}
}).then(response => {
//
console.log('评价发送成功');
}).catch(error => {
//
console.error('评价发送失败', error);
});
},
fetchEvaluation() {
axios.get(`http://106.52.218.118:8081/evaluate/getEvaluation?eid=${this.eid}`)
.then(response => {
this.evaluation = response.data;// evaluation
})
.catch(error => {
console.error('获取评价信息失败', error);
});
},
handleRateChange(satisfaction) {
this.evaluation.satisfaction = satisfaction; //
}
},
mounted() {
this.fetchEvaluation(); // fetchEvaluation
}
};
</script>
<style scoped>
.user-feedback {
max-width: 600px;
margin: 0 auto;
}
.feedback-input {
margin-bottom: 20px;
}
textarea {
width: 100%;
padding: 8px;
font-size: 16px;
border: 1px solid #28a7a3;
border-radius: 4px;
margin-bottom: 10px;
}
button {
padding: 8px 16px;
font-size: 16px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #003f3f;
cursor: pointer;
}
.submitted-feedback {
border-top: 1px solid #a6cfee;
padding-top: 20px;
}
.feedback-item {
background-color: #abd4ee;
border: 1px solid #c2f1fb;
border-radius: 4px;
padding: 10px;
}
.feedback-item p {
margin: 0;
}
</style>

@ -0,0 +1,47 @@
<template>
<el-button @click="add">Add Item</el-button>
<el-button @click="onDelete">Delete Item</el-button>
<el-scrollbar max-height="800px">
<p v-for="item in count" :key="item" class="scrollbar-demo-item">
{{ item }}
</p>
<p v-for="review in reviews" :key="review.id" class="scrollbar-demo-item">
{{ review.content }}
</p>
</el-scrollbar>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const count = ref(3)
const reviews = ref([
{ id: 1, content: 'Great product!' },
{ id: 2, content: 'Fast shipping!' },
{ id: 3, content: 'Excellent customer service!' }
])
const add = () => {
count.value++
}
const onDelete = () => {
if (count.value > 0) {
count.value--
}
}
</script>
<style scoped>
.scrollbar-demo-item {
display: flex;
align-items: center;
justify-content: center;
height: 50px;
margin: 10px;
text-align: center;
border-radius: 4px;
background: var(--el-color-primary-light-9);
color: var(--el-color-primary);
}
</style>

@ -1,40 +0,0 @@
<template>
<div class="home-container">
<h1>欢迎来到主页</h1>
<!-- 在这里添加你的主页内容 -->
</div>
</template>
<style scoped>
.home-container {
/* 添加你的样式 */
text-align: center;
padding: 20px;
}
</style>
<script>
export default {
name: 'Home'
}
</script>

@ -1,14 +1,17 @@
<template> <template>
<div class="home-container"> <div class="home-container">
<h1>首页</h1> <div class="return">
<button class="addDemand-button" @click="gotoAddDemandPage()">+</button>
</div>
<h1>首页</h1>
<div class="search-container"> <div class="search-container">
<input type="text" class="search-input" placeholder="世界这么大出去看看吧"> <input type="text" class="search-input" placeholder="世界这么大出去看看吧">
<button class="search-button" @click="gotoSearchPage()"></button> <button class="search-button" @click="gotoSearchPage()"></button>
</div> </div>
<div class="image-container"> <div class="image-container">
<img src="../../photos/background.png" alt="图片描述" class="search-image"> <img src="../data/picture/background.png" alt="图片描述" class="search-image">
</div> </div>
<div class="footer-nav"> <div class="footer-nav">
@ -67,7 +70,21 @@
/* 搜索按钮点击时的样式 */ /* 搜索按钮点击时的样式 */
background-color: #bbb; background-color: #bbb;
} }
.addDemand-button {
/* 定义返回按钮的样式 */
position: fixed; /* 使按钮位置固定 */
top: 10px;
left: 10px;
margin: 0;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav { .footer-nav {
/* 定义底部导航的样式 */ /* 定义底部导航的样式 */
position: fixed; position: fixed;
@ -100,9 +117,6 @@
export default { export default {
name: 'Home', name: 'Home',
methods: { methods: {
gotohome() {
this.$router.push('/home');
},
gotomessage() { gotomessage() {
this.$router.push('/message'); this.$router.push('/message');
}, },
@ -112,6 +126,9 @@ export default {
gotoSearchPage() { gotoSearchPage() {
this.$router.push('/searchPage'); this.$router.push('/searchPage');
}, },
gotoAddDemandPage() {
this.$router.push('/addDemandPage');
},
} }
} }
</script> </script>

@ -1,9 +1,9 @@
<template> <template>
<div class="login-container"> <div class="login-container">
<h1>登录页面</h1> <h1>登录</h1>
<form @submit.prevent="login" class="login-form"> <form @submit.prevent="login" class="login-form">
<label for="username">用户名</label> <label for="phone">手机号</label>
<input type="text" id="username" v-model="username" class="input-field"> <input type="text" id="phone" v-model="phone" class="input-field">
<br> <br>
<label for="password">密码</label> <label for="password">密码</label>
<input type="password" id="password" v-model="password" class="input-field"> <input type="password" id="password" v-model="password" class="input-field">
@ -53,21 +53,21 @@
import { login } from '../api/auth' import { login } from '../api/auth'
import axios from "axios"; import axios from "axios";
export default { export default {
data() { data() {
return { return {
username: '', phone: '',
password: '' password: ''
} }
}, },
methods: { methods: {
login() { login() {
console.log("用户名:", this.username); console.log("手机号:", this.phone);
console.log("密码:", this.password); console.log("密码:", this.password);
axios.post('http://192.168.254.35:8080/Login/login', { axios.post('http://106.52.218.118:12607/Login/login', {
// //
username: this.username, phone: this.phone,
password: this.password password: this.password
}, { }, {
// cookie // cookie
@ -77,9 +77,9 @@ export default {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
}) })
.then(response => { .then(response => {
// status
if (response.data == 1) { if (response.data == 1) {
sessionStorage.setItem('phone', this.phone);
// //
this.$router.push('/home'); this.$router.push('/home');
} }

@ -0,0 +1,113 @@
<template>
<div class="payment">
<h2>支付订单</h2>
<div class="order-summary">
<p>订单金额: {{ orderAmount }} </p>
</div>
<div class="payment-form">
<label for="cardNumber">银行卡号</label>
<input type="text" id="cardNumber" v-model.trim="cardNumber" placeholder="请输入银行卡号">
<label for="expiry">到期日期</label>
<input type="text" id="expiry" v-model.trim="expiry" placeholder="MM/YY">
<label for="cvv">CVV</label>
<input type="text" id="cvv" v-model.trim="cvv" placeholder="请输入CVV">
<button @click="submitPayment" :disabled="loading">支付</button>
<p v-if="error" class="error-message">{{ error }}</p>
</div>
</div>
</template>
<script>
export default {
data() {
return {
orderAmount: 100, // 100
cardNumber: '',
expiry: '',
cvv: '',
loading: false,
error: ''
};
},
methods: {
submitPayment() {
//
this.loading = true;
const paymentData = {
cardNumber: this.cardNumber,
expiry: this.expiry,
cvv: this.cvv,
amount: this.orderAmount
};
// '/api/payment'
fetch('/api/payment', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(paymentData)
})
.then(response => {
if (!response.ok) {
throw new Error('支付失败,请稍后重试。');
}
return response.json();
})
.then(data => {
//
console.log('支付成功:', data);
this.error = '';
})
.catch(error => {
//
console.error('支付失败:', error.message);
this.error = error.message;
})
.finally(() => {
this.loading = false;
});
}
}
};
</script>
<style scoped>
.payment {
max-width: 600px;
margin: 0 auto;
}
.order-summary {
margin-bottom: 20px;
}
label {
font-weight: bold;
}
input {
padding: 8px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 8px 16px;
font-size: 16px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.error-message {
color: #dc3545;
}
</style>

@ -1,14 +1,26 @@
<template> <template>
<div class="register-container"> <div class="register-container">
<h1>注册页面</h1> <h1>注册</h1>
<form @submit.prevent="register" class="register-form"> <form @submit.prevent="register" class="register-form">
<label for="username">用户名</label> <label for="phone">手机号</label>
<input type="text" id="username" v-model="username" class="input-field"> <input type="phone" id="phone" v-model="phone" class="input-field">
<br> <br>
<label for="password">密码</label> <label for="password">密码</label>
<input type="password" id="password" v-model="password" class="input-field"> <input type="password" id="password" v-model="password" class="input-field">
<br> <br>
<label for="name">姓名</label>
<input type="name" id="name" v-model="name" class="input-field">
<br>
<label for="IDcard">身份证号</label>
<input type="IDcard" id="IDcard" v-model="IDcard" class="input-field">
<br>
<label for="nickname">昵称</label>
<input type="nickname" id="nickname" v-model="nickname" class="input-field">
<br>
<button type="submit" class="submit-button">注册</button> <button type="submit" class="submit-button">注册</button>
<button class="return-button" @click="gotoLogin()"></button> <button class="return-button" @click="gotoLogin()"></button>
</form> </form>
@ -57,19 +69,28 @@ import axios from "axios";
export default { export default {
data() { data() {
return { return {
username: '', phone: '',
password: '' password: '',
name:'',
nickname:'',
IDcard:''
} }
}, },
methods: { methods: {
register() { register() {
console.log("用户名:", this.username); console.log("", this.phone);
console.log("密码:", this.password); console.log("密码:", this.password);
console.log("姓名:",this.name);
axios.post('http://192.168.254.35:8080/Login/register', { console.log("身份证号:",this.IDcard);
console.log("昵称:",this.nickname);
axios.post('http://106.52.218.118:12607/Login/register', {
// //
username: this.username, phone: this.phone,
password: this.password password: this.password,
name:this.name,
IDCard:this.IDcard,
nickname:this.nickname
}, { }, {
// cookie // cookie
withCredentials: true, withCredentials: true,
@ -81,12 +102,12 @@ export default {
.then(response => { .then(response => {
console.log(response.data) console.log(response.data)
// //
alert(response.data); alert("注册成功");
}) })
.catch(error => { .catch(error => {
console.error(error) console.error(error)
// //
alert(response.data); alert("已注册");
}) })
}, },
gotoLogin(){ gotoLogin(){

@ -0,0 +1,103 @@
<template>
<div class="security-verification">
<h2>安全验证</h2>
<!-- 身份证号验证 -->
<div class="verification-item">
<label for="idCard">身份证号</label>
<input type="text" id="idCard" v-model.trim="IDcard" placeholder="请输入身份证号">
<p v-if="IDcard !== ''" class="invalid-message"></p>
</div>
<div class="verification-item">
<label for="name">姓名</label>
<input type="text" id="name" v-model.trim="name" placeholder="请输入姓名">
<p v-if="name !== ''" class="invalid-message"></p>
</div>
<p v-if="error" class="error-message">{{ error }}</p>
</div>
<button @click="verify" :disabled="loading">验证</button>
<p v-if="idCardValid && nameValid" class="valid-message"></p>
</template>
<script>
export default {
data() {
return {
IDcard: '',
IDcardValid: false,
name: '',
nameValid: false,
loading: false,
error: ''
};
},
methods: {
verify() {
this.loading = true;
//
setTimeout(() => {
if (/^\d{17}[\dXx]$/.test(this.idCard)) {
this.idCardValid = true;
this.error = '';
} else {
this.idCardValid = false;
this.error = '请输入有效的身份证号!';
}
this.loading = false;
}, 1000); // 1
},
}
};
</script>
<style scoped>
.security-verification {
max-width: 600px;
margin: 0 auto;
}
.verification-item {
margin-bottom: 20px;
}
label {
font-weight: bold;
}
input {
padding: 8px;
font-size: 16px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 8px 16px;
font-size: 16px;
border: none;
border-radius: 4px;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
button:disabled {
background-color: #ccc;
cursor: not-allowed;
}
.valid-message {
color: #28a745;
}
.invalid-message {
color: #dc3545;
}
.error-message {
color: #dc3545;
}
</style>

@ -0,0 +1,114 @@
<script lang="ts" setup>
import { ref, onBeforeMount, watch, watchEffect } from 'vue'
import axios from 'axios'
import { ElSelect, ElOption } from 'element-plus'
import { AreaList } from '../components/types'
import { format, addDays } from 'date-fns'
import Return from '../components/return.vue'
const province = ref('')
const city = ref('')
const area = ref('')
const remark = ref('')
const provinceList = ref<AreaList[]>([])
const cityList = ref<AreaList[]>([])
const areaList = ref<AreaList[]>([])
const rangeValue = ref<string[]>([format(new Date(), 'yyyy-MM-dd'), format(addDays(new Date(), 1), 'yyyy-MM-dd')])
// JSON
const getProvinceList = async () => {
const res = await axios.get<AreaList[]>('https://yjy-oss-files.oss-cn-zhangjiakou.aliyuncs.com/tuxian/area.json')
provinceList.value = res.data;
console.log(provinceList.value);
}
const publish = () => {
//
if(city.value!=''){
axios.post(`http://106.52.218.118:12607/users/pupdate`,{city:city.value,time:rangeValue.value,remark:remark.value})
.then(response => {
alert("发布成功");
})
.catch(error => {
console.error('发布失败', error);
});}
else{
alert("请输入目的地")
}
};
onBeforeMount(async()=>{
getProvinceList();
})
watchEffect(() => {
console.log('rangeValue:', rangeValue.value)
})
//
watch(province, (newValue, oldValue) => {
const matchedProvince = provinceList.value.find(item => item.name === newValue)
if (matchedProvince) {
cityList.value = matchedProvince.areaList
city.value = '' //
areaList.value = [] //
console.log(cityList.value)
}
})
//
watch(city, (newValue, oldValue) => {
const matchedCity = cityList.value.find(item => item.name === newValue)
if (matchedCity) {
areaList.value = matchedCity.areaList
area.value = '' //
console.log(areaList.value)
}
})
</script>
<template>
<div>
<Return></Return>
</div>
<div><h2>发布需求</h2></div>
<div class="addDemand-container">
<div style="display: flex;">
<p style="color: red;">*</p>
<el-select v-model="province" clearable placeholder="省份">
<el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
<el-select v-model="city" clearable placeholder="城市">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
<!--<el-select v-model="area" clearable placeholder="Select">
<el-option v-for="item in areaList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>-->
</div>
<div>
<VueDatePicker
placeholder="请选择出行时间"
range
:min-date="new Date()"
format="yyyy-MM-dd"
:width="280"
v-model="rangeValue" />
</div>
<div>
<label for="user-input">备注信息:</label>
<input type="text" id="remark" v-model="remark" placeholder="">
</div>
<el-button type="primary" @click="publish"></el-button>
</div>
</template>
<style>
.addDemand-container {
max-width: 400px;
margin: 0 auto;
padding: 30px;
border: 1px solid #00ff00;
border-radius: 5px;
text-align: center;
}
</style>

@ -0,0 +1,119 @@
<script lang="ts" setup>
import { ref, onBeforeMount, watch, watchEffect } from 'vue'
import axios from 'axios'
import { ElSelect, ElOption } from 'element-plus'
import { AreaList } from '../components/types'
import { format, addDays } from 'date-fns'
import Return from '../components/return.vue'
const province = ref('')
const city = ref('')
const area = ref('')
const remark = ref('')
const provinceList = ref<AreaList[]>([])
const cityList = ref<AreaList[]>([])
const areaList = ref<AreaList[]>([])
const rangeValue = ref<string[]>([format(new Date(), 'yyyy-MM-dd'), format(addDays(new Date(), 1), 'yyyy-MM-dd')])
// JSON
const getProvinceList = async () => {
const res = await axios.get<AreaList[]>('https://yjy-oss-files.oss-cn-zhangjiakou.aliyuncs.com/tuxian/area.json')
provinceList.value = res.data
console.log(provinceList.value)
}
const publish = () => {
//
if(city.value!=''){
axios.post(`http://106.52.218.118:8081/SendGuideService/register`,{phone:sessionStorage.getItem('phone') || '',city:city.value,time:rangeValue.value,remark:remark.value})
.then(response => {
alert("发布成功")
})
.catch(error => {
console.error('发布失败', error);
});}
else{
alert("请输入目的地")
}
};
onBeforeMount(async()=>{
getProvinceList()
})
watchEffect(() => {
console.log('rangeValue:', rangeValue.value)
})
//
watch(province, (newValue, oldValue) => {
const matchedProvince = provinceList.value.find(item => item.name === newValue)
if (matchedProvince) {
cityList.value = matchedProvince.areaList
city.value = '' //
areaList.value = [] //
console.log(cityList.value)
}
})
//
watch(city, (newValue, oldValue) => {
const matchedCity = cityList.value.find(item => item.name === newValue)
if (matchedCity) {
areaList.value = matchedCity.areaList
area.value = '' //
console.log(areaList.value)
}
})
</script>
<template>
<div>
<Return></Return>
</div>
<div><h1>导游服务</h1></div>
<div class="addServe-container">
<h3>选择导游城市</h3>
<div style="display: flex;">
<p style="color: red;">*</p>
<el-select v-model="province" clearable placeholder="省份">
<el-option v-for="item in provinceList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
<el-select v-model="city" clearable placeholder="城市">
<el-option v-for="item in cityList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>
<!--<el-select v-model="area" clearable placeholder="Select">
<el-option v-for="item in areaList" :key="item.code" :label="item.name" :value="item.name" />
</el-select>-->
</div>
<h3>选择导游时间</h3>
<div>
<VueDatePicker
placeholder="请选择出行时间"
range
:min-date="new Date()"
format="yyyy-MM-dd"
:width="280"
v-model="rangeValue" />
</div>
<h3>添加备注信息</h3>
<div>
<label for="user-input">备注信息:</label>
<input type="text" id="remark" v-model="remark" placeholder="">
</div>
<el-button type="primary" @click="publish"style="margin-top: 20px;">发布</el-button>
</div>
</template>
<style>
.addServe-container {
max-width: 400px;
margin: 0 auto;
padding: 30px;
border: 1px solid #000000;
border-radius: 5px;
text-align: center;
}
</style>

@ -12,9 +12,6 @@
<button @click="toggleNicknameInput"></button> <button @click="toggleNicknameInput"></button>
</div> </div>
<h1>{{ user.name }}</h1>
<p>身份证号{{user.IDCard}}</p>
<div v-if="showEmailInput"> <div v-if="showEmailInput">
<label for="email">邮箱</label> <label for="email">邮箱</label>
@ -100,8 +97,8 @@ button {
<script> <script>
import axios from 'axios'; import axios from 'axios';
export default { export default {
props: ['phone'],
data() { data() {
return { return {
user: {}, user: {},
@ -109,23 +106,24 @@ export default {
showNicknameInput: false, showNicknameInput: false,
email: '', email: '',
showEmailInput: false, showEmailInput: false,
phone: '', phone:sessionStorage.getItem('phone') || '',
showPhoneInput: false, showPhoneInput: false,
IDCard: '', IDCard: '',
createtime: '', createtime: '',
status: 0, status: 0,
}; };
}, },
/*computed: {
...mapGetters(['getPhone'])
},*/
created() { created() {
//
this.fetchUser(this.phone); this.fetchUser(this.phone);
}, },
methods: { methods: {
fetchUser(phone) { fetchUser(phone) {
// API // API
axios.get(`http://192.168.254.35:8080/users/getByPhone?phone=15616168609`) axios.get(`http://106.52.218.118:12607/users/getByPhone?phone=${phone}`)
.then(response => { .then(response => {
alert(response.data);
this.user = response.data; this.user = response.data;
}) })
.catch(error => { .catch(error => {
@ -138,7 +136,8 @@ export default {
this.nickname = this.user.nickname; this.nickname = this.user.nickname;
}, },
updateNickname(){ updateNickname(){
axios.get(`http://192.168.254.35:8080/users/getByPhone?phone=15616168609`, { nickname: this.nickname }) this.user.nickname = this.nickname;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
.then(response => { .then(response => {
this.user.nickname = this.nickname; this.user.nickname = this.nickname;
this.toggleNicknameInput(); // this.toggleNicknameInput(); //
@ -153,7 +152,8 @@ export default {
}, },
updateEmail() { updateEmail() {
// //
axios.get(`http://192.168.254.35:8080/users/getByPhone?phone=15616168609`, { email: this.email }) this.user.email = this.email;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
.then(response => { .then(response => {
this.user.email = this.email; this.user.email = this.email;
this.toggleEmailInput(); // this.toggleEmailInput(); //
@ -167,9 +167,10 @@ export default {
this.phone = this.user.phone; this.phone = this.user.phone;
}, },
updatePhone(){ updatePhone(){
axios.get(`http://192.168.254.35:8080/users/getByPhone?phone=15616168609`, { phone: this.phone }) this.user.phone = this.phone;
axios.post(`http://106.52.218.118:12607/users/pupdate`,{user:this.user})
.then(response => { .then(response => {
alert(this.phone); sessionStorage.setItem('phone', this.phone);
this.user.phone = this.phone; this.user.phone = this.phone;
this.togglePhoneInput(); // this.togglePhoneInput(); //
}) })

@ -0,0 +1,79 @@
<template>
<div>
<Return></Return>
</div>
<div>
<h1>平台导游资格申请</h1>
<form @submit.prevent="submitForm">
<div>
<label for="experience">有无相关经历:</label>
<input type="radio" id="has-experience-yes" value="true" v-model="registerToGuide.re" required>
<label for="has-experience-yes"></label>
<input type="radio" id="has-experience-no" value="false" v-model="registerToGuide.re">
<label for="has-experience-no"></label>
</div>
<div>
<label for="rsd">居住地区:</label>
<input type="text" id="rsd" v-model="registerToGuide.rsd">
</div>
<div>
<label for="familiar-area">熟悉区域:</label>
<textarea id="familiar-area" v-model="registerToGuide.fa"></textarea>
</div>
<div>
<label for="syns">个人简介:</label>
<textarea id="syns" v-model="registerToGuide.syns"></textarea>
</div>
<button @click="Submit()"></button>
</form>
</div>
</template>
<script>
import axios from 'axios';
import Return from '../components/return.vue'
export default {
data() {
return{
registerToGuide:{
uid:0,
re: '', // 'yes''no'
rsd: '',
fa: '',
syns: '',
},
};
},
methods:{
Submit(){
axios.get(`http://106.52.218.118:8081/users/getUid?phone=${sessionStorage.getItem('phone')}`)
.then(response => {
this.registerToGuide.uid = response.data
axios.post(`http://106.52.218.118:8081/users/registerToGuide`,{registerToGuide:this.registerToGuide})
.then(response => {
if(response.data == 1){
alert("申请成功!")
this.$router.push('/addServe')
}else{
alert("申请未通过!")
}
})
.catch(error => {
console.error('Error fetching user:', error);
});
})
.catch(error => {
console.error('Error fetching user:', error);
});
}
},
components:{
Return,
},
};
</script>
<style scoped>
/* 添加你的样式 */
</style>

@ -1,16 +1,23 @@
<script>
import Return from '../components/return.vue'
export default {
name: 'SearchPage',
components: {
Return
},
}
</script>
<template> <template>
<div class="home-container"> <div class="home-container">
<div>
<div class="return"> <Return></Return>
<button class="return-button" @click="gotohome()"></button> </div>
</div>
<div class="search-container"> <div class="search-container">
<input type="text" class="search-input" placeholder="世界这么大出去看看吧"> <input type="text" class="search-input" placeholder="世界这么大出去看看吧">
<button class="search-button" @click="search"></button> <button class="search-button" @click="search"></button>
</div> </div>
</div> </div>
</template> </template>
<style scoped> <style scoped>
@ -49,20 +56,6 @@
background-color: #bbb; background-color: #bbb;
} }
.return-button {
/* 定义返回按钮的样式 */
position: fixed; /* 使按钮位置固定 */
top: 10px;
left: 10px;
margin: 0;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #ccc;
color: #333;
cursor: pointer;
}
.footer-nav button { .footer-nav button {
/* 定义按钮的样式 */ /* 定义按钮的样式 */
flex: 1; flex: 1;
@ -79,13 +72,3 @@
} }
</style> </style>
<script>
export default {
name: 'SearchPage',
methods: {
gotohome() {
this.$router.push('/home');
},
}
}
</script>

@ -0,0 +1,8 @@
<template>
</template>
<script>
</script>
<style>
</style>

@ -1,19 +1,31 @@
import { createWebHistory, createRouter } from 'vue-router'; import { createWebHistory, createRouter } from 'vue-router';
import Login from '../components/Login.vue'; import Login from '../pages/Login.vue';
import Register from '../components/Register.vue'; import Register from '../pages/Register.vue';
import Home from '../components/HomePage.vue'; import Home from '../pages/HomePage.vue';
import Message from '../components/message.vue'; import Mine from '../pages/mine.vue';
import Mine from '../components/mine.vue'; import SearchPage from '../pages/searchPage.vue';
import SearchPage from '../components/searchPage.vue'; import Test from '../pages/test.vue'
import Communication from '../pages/Communication.vue'
import Pay from "@/pages/Pay.vue";
import addDemand from "@/pages/addDemand.vue";
import DemandList from "@/pages/DemandList.vue";
import Evaluation from "@/pages/Evaluation.vue";
import SecurityVerification from "@/pages/SecurityVerification.vue";
const routes = [ const routes = [
{ path: '/', redirect: '/login' }, // 重定向到/login路径 { path: '/', redirect: '/login' }, // 重定向到/login路径
{ path: '/login', component: Login }, { path: '/login', component: Login },
{ path: '/register', component: Register }, { path: '/register', component: Register },
{ path: '/home', component: Home }, { path: '/home', component: Home },
{ path: '/message', component: Message },
{ path: '/mine', component: Mine }, { path: '/mine', component: Mine },
{ path: '/searchPage', component: SearchPage }, { path: '/searchPage', component: SearchPage },
{ path: '/addDemandPage', component: addDemand },
{ path: '/test', component: Test },
{ path: '/message', component: Communication },
{ path: '/pay', component:Pay},
{ path: '/demandlist', component:DemandList},
{ path: '/evaluation', component:Evaluation},
{ path: '/SecurityVerification', component:SecurityVerification}
]; ];
const router = createRouter({ const router = createRouter({

@ -1,17 +0,0 @@
import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
})

@ -1,33 +0,0 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

Binary file not shown.

@ -1,2 +0,0 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar

@ -18,7 +18,7 @@ public class Configurer implements WebMvcConfigurer {
.allowCredentials(true) .allowCredentials(true)
//放行哪些原始域 //放行哪些原始域
.allowedOriginPatterns("*") .allowedOriginPatterns("*")
.allowedMethods(new String[]{"GET", "POST", "PUT", "DELETE"}) .allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("*") .allowedHeaders("*")
.exposedHeaders("*"); .exposedHeaders("*");
} }

@ -0,0 +1,13 @@
package com.softegg.freetogo.Demand.Dao;
import com.softegg.freetogo.Demand.bean.Demands;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @description:Jpa
* @author:wuyifan
* @date:2024/5/10 19:50
*/
public interface DemandsRepository extends JpaRepository<Demands, Integer> {
}

@ -0,0 +1,47 @@
package com.softegg.freetogo.Demand.bean;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @description:demand
* @author:wuyifan
* @date:2024/5/10 11:36
*/
@Entity
@Table(name="demands")
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Demands {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer uid;
@Column
private String phone;//游客手机号码
@Column
private boolean touristGender;//游客性别 ture:male, false:female
@Column
private String nickname;//发布需求的游客昵称信息
@Column
private String createTime;//需求发布时间
@Column
private String departureDate;//游客需求起始日期
@Column
private String endDate;//游客需求结束日期
@Column
private String sumDay;//游客旅游总天数
@Column
private String city;//发布需求的目的城市
@Column
private String message;//需求备注内容
// @Column
// private boolean guideGender;//希望导游性别
// @Column
// private int status;
}

@ -0,0 +1,85 @@
package com.softegg.freetogo.Demand.controller;
import com.softegg.freetogo.Demand.bean.Demands;
import com.softegg.freetogo.Demand.service.DemandsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @description:Demand
* @author:wuyifan
* @date:2024/5/10 11:40
*/
@RestController
//@CrossOrigin(origins = "*")
@RequestMapping("/demands")
public class DemandsController {
@Autowired
private DemandsService demandsService;
@GetMapping("findAll")
public List<Demands> findAll() {
return demandsService.findAll();
}
@GetMapping("add")
public String add(String phone,
boolean tGender,
String nkn,
String ct,
String dDate,
String eDate,
String sDay,
String city,
String message) {
Demands demand = new Demands();
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message, demand);
demandsService.add(demand);
return "添加成功";
}
@GetMapping("delbyid")
public String delById(int id) {
demandsService.deleteById(id);
return "删除成功";
}
@GetMapping("findbyid")
public Demands getUserById(int id) {
return demandsService.getDemandById(id);
}
@GetMapping("update")
public String update(int id,
String phone,
boolean tGender,
String nkn,
String ct,
String dDate,
String eDate,
String sDay,
String city,
String message) {
Demands demand = demandsService.getDemandById(id);
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message, demand);
demandsService.update(demand);
return "更新成功";
}
private void setDemands(String phone, boolean tGender, String nkn, String ct, String dDate, String eDate, String sDay, String city, String message, Demands demand) {
demand.setPhone(phone);
demand.setTouristGender(tGender);
demand.setNickname(nkn);
demand.setCreateTime(ct);
demand.setDepartureDate(dDate);
demand.setEndDate(eDate);
demand.setSumDay(sDay);
demand.setCity(city);
demand.setMessage(message);
// demand.setGuideGender(gGender);
}
}

@ -0,0 +1,23 @@
package com.softegg.freetogo.Demand.service;
import com.softegg.freetogo.Demand.bean.Demands;
import java.util.List;
/**
* @description:
* @author:wuyifan
* @date:2024/5/10 2059
*/
public interface DemandsService {
List<Demands> findAll();//查找所有需求
void add(Demands demand);//以demand为用户入库
void deleteById(int id);//删除对应id需求
Demands getDemandById(int id);//获得对应id需求
void update(Demands demand);//更新需求信息
}

@ -0,0 +1,92 @@
package com.softegg.freetogo.Demand.service;
import com.softegg.freetogo.Demand.Dao.DemandsRepository;
import com.softegg.freetogo.Demand.bean.Demands;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @description:
* @author:wuyifan
* @date:2024/5/10 19:50
*/
@Component
public class DemandsServiceImpl implements DemandsService {
@Autowired
private DemandsRepository DemandsRepository;
/**
* @description:
* @param: null
* @return: java.util.List<com.softegg.freetogo.Demand.Bean.Demands>
* @author: wuyifan
* @date: 2024/5/10 19:53
*/
public List<Demands> findAll() {
System.out.println("查询成功");
return DemandsRepository.findAll();
}
/**
* @description: demand
* @param: demand
* @return: void
* @author: wuyifan
* @date: 2024/5/10 19:55
*/
public void add(Demands demand) {
DemandsRepository.save(demand);
System.out.println("添加成功");
}
/**
* @description: id
* @param: id
* @return: void
* @author: wuyifan
* @date: 2024/5/10 19:59
*/
public void deleteById(int id) {
DemandsRepository.deleteById(id);
System.out.println("删除成功");
}
/**
* @description: id
* @param: id
* @return: com.softegg.freetogo.Demand.Bean.Demands
* @author: wuyifan
* @date: 2024/5/10 20:02
*/
public Demands getDemandById(int id) {
return DemandsRepository.findById(id).orElse(null);
}
/**
* @description:
* @param: demand
* @return: void
* @author: wuyifan
* @date: 2024/5/10 20:05
*/
public void update(Demands demand) {
DemandsRepository.save(demand);
System.out.println("更新成功");
}
// /**
// * @description: 判断相同需求是否已经入库
// * @param: id
// * @return: boolean
// * @author: wuyifan
// * @date: 2024/5/10 20:05
// */
// public boolean isRegister(int id) {
// Demands demand = DemandsRepository.findById(id);
// System.out.println(demand);
// return users != null;
// }
}

@ -0,0 +1,15 @@
package com.softegg.freetogo.Evaluate.Dao;
import com.softegg.freetogo.Evaluate.bean.Evaluations;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @description: Jpa
* @author: zhanglinhao
* @date: 2024/5/10 9:27
*/
public interface EvaluateRepository extends JpaRepository<Evaluations, Integer> {
List<Evaluations> findByEditorPhone(String phone);
}

@ -0,0 +1,38 @@
package com.softegg.freetogo.Evaluate.bean;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
/**
* @description:
* @author:zhanglinhao
* @date:2024/5/10 9:07
*/
@Entity
@Table(name = "evaluation")
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class Evaluations {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int eid;
@Column(name = "etorname")
private String editorName;
@Column(name = "etorphone")
private String editorPhone;
@Column(name = "etedname")
private String editedName;
@Column(name = "etedphone")
private String editedPhone;
@Column(name = "createtime")
private String ct;
@Column(name = "modifytime")
private String mt;
@Column
private String ebody;
}

@ -0,0 +1,58 @@
package com.softegg.freetogo.Evaluate.controller;
import com.softegg.freetogo.Evaluate.bean.Evaluations;
import com.softegg.freetogo.Evaluate.service.EvaluateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @description:
* @author: zhanglinhao
* @date: 2024/5/11 17:33
*/
@RestController
@RequestMapping("/evaluate")
public class EvaluationController {
@Autowired
EvaluateService evaluateService;
/**
* @description:
* @param: null
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
* @author: zhanglinhao
* @date: 2024/5/12 0:11
*/
@GetMapping("findAllEvaluation")
public List<Evaluations> findAllEvaluation() {
return evaluateService.evaluationList();
}
/**
* @description:
* @param: ebody
* @return: void
* @author: zhanglinhao
* @date: 2024/5/12 0:28
*/
@PostMapping("addEvaluation")
public void addEvaluation(@RequestBody Map<String, Evaluations> ebody) {
Evaluations evaluation = ebody.get("evaluation");
evaluateService.addEvaluation(evaluation);
}
/**
* @description:
* @param: phone
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
* @author: zhanglinhao
* @date: 2024/5/12 0:30
*/
@GetMapping("evaluationByPhone")
public List<Evaluations> evaluationByPhone(String phone) {
return evaluateService.getEListByPhone(phone);
}
}

@ -0,0 +1,30 @@
package com.softegg.freetogo.Evaluate.service;
import com.softegg.freetogo.Evaluate.bean.Evaluations;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @description:
* @author:zhanglinhao
* @date:2024/5/10 8:52
*/
@Service
public interface EvaluateService {
List<Evaluations> evaluationList();//获取所有评论
<<<<<<< HEAD
List<Evaluations> getEListByPhone(String phone);//根据电话筛选评价
void addEvaluation(Evaluations evaluation);//添加评论
=======
List<Evaluations> getEListByPhone(String phone);//根据电话筛选评价
void addEvaluation(Evaluations evaluation);//添加评论
void editEvaluation(int eid, String ebody);//编辑评论
void deleteEvaluation(int eid);//删除评论
>>>>>>> zhanglinhao_branch
}

@ -0,0 +1,109 @@
package com.softegg.freetogo.Evaluate.service;
import com.softegg.freetogo.Evaluate.Dao.EvaluateRepository;
import com.softegg.freetogo.Evaluate.bean.Evaluations;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Optional;
/**
* @description:
* @author:zhanglinhao
* @date:2024/5/10 9:25
*/
@Component
public class EvaluateServiceImpl implements EvaluateService {
@Autowired
EvaluateRepository evaluateRepository;
/**
* @description:
* @param: null
* @return: void
* @author: zhanglinhao
* @date: 2024/5/10 9:25
*/
@Override
public List<Evaluations> evaluationList() {
System.out.println("查询评论");
return evaluateRepository.findAll();
}
/**
* @description:
* @param: phone
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
* @author: zhanglinhao
* @date: 2024/5/11 16:28
*/
@Override
public List<Evaluations> getEListByPhone(String phone) {
System.out.println("查询"+phone+"的评论");
return evaluateRepository.findByEditorPhone(phone);
}
/**
* @description:
* @param: phone
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
* @author: zhanglinhao
* @date: 2024/5/11 16:28
*/
@Override
public List<Evaluations> getEListByPhone(String phone) {
System.out.println("查询" + phone + "的评论");
return evaluateRepository.findByEditorPhone(phone);
}
/**
* @description:
* @param: evaluation
* @return: void
* @author: zhanglinhao
* @date: 2024/5/10 21:20
*/
@Override
public void addEvaluation(Evaluations evaluation) {
evaluateRepository.save(evaluation);
System.out.println("添加评论" + evaluation.getEbody());
}
<<<<<<< HEAD
=======
/**
* @description:
* @param: eid
* @return: void
* @author: zhanglinhao
* @date: 2024/5/11 17:10
*/
@Override
public void editEvaluation(int eid, String ebody) {
System.out.println("编辑评论:" + eid);
Optional<Evaluations> opt = evaluateRepository.findById(eid);
if (opt.isPresent()) {
Evaluations evaluation = opt.get();
evaluation.setEbody(ebody);
evaluateRepository.save(evaluation);
System.out.println("编辑成功:" + eid);
}
}
/**
* @description:
* @param: eid
* @return: void
* @author: zhanglinhao
* @date: 2024/5/11 17:28
*/
@Override
public void deleteEvaluation(int eid) {
evaluateRepository.deleteById(eid);
System.out.println("删除评论:" + eid);
}
>>>>>>> zhanglinhao_branch
}

@ -1,9 +1,7 @@
package com.softegg.freetogo; package com.softegg.freetogo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@SpringBootApplication @SpringBootApplication
public class FreeToGoApplication { public class FreeToGoApplication {

@ -32,12 +32,25 @@ public class LoginController {
@PostMapping("login") @PostMapping("login")
public int Login(@RequestBody Map<String, Object> map) { public int Login(@RequestBody Map<String, Object> map) {
System.out.println(map); System.out.println(map);
System.out.println(map.get("username").toString()); <<<<<<< HEAD
System.out.println(map.get("password").toString()); System.out.println("phone:"+map.get("phone").toString());
return switch (loginService.loginAccount(map.get("username").toString(), map.get("password").toString())) { System.out.println("password"+map.get("password").toString());
int tag = loginService.loginAccount(map.get("name").toString(), map.get("password").toString());
System.out.println("LoginTag:"+tag);
=======
System.out.println("phone:" + map.get("phone").toString());
System.out.println("password" + map.get("password").toString());
int tag = loginService.loginAccount(map.get("name").toString(), map.get("password").toString());
System.out.println("LoginTag:" + tag);
>>>>>>> zhanglinhao_branch
return switch (tag) {
case 1000 -> 1;//登陆成功 case 1000 -> 1;//登陆成功
case 1001 -> 2;//密码或账号错误 case 1001 -> 2;//密码或账号错误
case 1002 -> 3;//该账户未注册 case 1002 -> 3;//该账户未注册
case 1005 -> 6;//未输入账号密码
case 1006 -> 7;//未输入账号
case 1007 -> 8;//未输入密码
case 1008 -> 9;//身份证输入错误
default -> 0; default -> 0;
}; };
} }
@ -51,7 +64,15 @@ public class LoginController {
*/ */
@PostMapping("register") @PostMapping("register")
public int Register(@RequestBody Map<String, Object> map) { public int Register(@RequestBody Map<String, Object> map) {
return switch (loginService.registerAccount(map.get("username").toString(), map.get("password").toString())) { System.out.println(map);
<<<<<<< HEAD
int tag = loginService.registerAccount((String)map.get("name"), (String)map.get("password"),(String)map.get("phone"),(String)map.get("nickname"),(String)map.get("IDCard"));
System.out.println("RegisterTag:"+tag);
=======
int tag = loginService.registerAccount((String) map.get("name"), (String) map.get("password"), (String) map.get("phone"), (String) map.get("nickname"), (String) map.get("IDCard"));
System.out.println("RegisterTag:" + tag);
>>>>>>> zhanglinhao_branch
return switch (tag) {
case 1003 -> 4;//该账户已经注册 case 1003 -> 4;//该账户已经注册
case 1004 -> 5;//注册成功 case 1004 -> 5;//注册成功
default -> 0; default -> 0;

@ -10,6 +10,11 @@ import org.springframework.stereotype.Service;
@Service @Service
public interface LoginService { public interface LoginService {
int loginAccount(String phone, String password);//登录 int loginAccount(String phone, String password);//登录
// int registerAccount(String phone, String password);
int registerAccount(String phone, String password);//注册 int registerAccount(String name,
String password,
String phone,
String nickname,
String IDCard);//注册
} }

@ -0,0 +1,108 @@
package com.softegg.freetogo.Login.service;
import com.softegg.freetogo.User.bean.Users;
import com.softegg.freetogo.User.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
<<<<<<< HEAD
import java.util.Objects;
=======
>>>>>>> zhanglinhao_branch
/**
* @description:
* @author:zhanglinhao
* @date:2024/5/9 9:33
*/
@Component
public class LoginServiceImpl implements LoginService {
@Autowired
UsersService usersService;
/**
* @description:
* @param: phone
* @param: password
* @return: int
* @author: zhanglinhao
* @date: 2024/5/9 22:46
*/
@Override
public int loginAccount(String phone, String password) {
if (phone.isEmpty() && password.isEmpty())
return 1005;//未输入账号密码
else if (phone.isEmpty())
return 1006;//未输入账号
else if (password.isEmpty())
return 1007;//未输入密码
if (usersService.isRegister(phone)) {
if (usersService.getUserByPhone(phone).getPassword().equals(password))
return 1000;//登录成功
else
return 1001;//密码或账号错误
} else
return 1002;//该账户未注册
}
/**
* @description:
* @param: name
* @param: password
* @param: phone
* @param: nickname
* @param: IDCard
* @return: int
* @author: zhanglinhao
* @date: 2024/5/11 15:57
*/
@Override
public int registerAccount(String name,
String password,
String phone,
String nickname,
String IDCard) {
if (usersService.isRegister(phone))
return 1003;//该账户已经注册
<<<<<<< HEAD
else if(IDCard.length()!=18)
return 1008;//身份证输入错误
else {
LocalDateTime currentTime = LocalDateTime.now();
System.out.println("注册信息:姓名:"+name+"密码:"+password+"电话:"+phone+"昵称:"+nickname+"身份证:"+IDCard);
=======
else if (IDCard.length() != 18)
return 1008;//身份证输入错误
else {
LocalDateTime currentTime = LocalDateTime.now();
System.out.println("注册信息:姓名:" + name + "密码:" + password + "电话:" + phone + "昵称:" + nickname + "身份证:" + IDCard);
>>>>>>> zhanglinhao_branch
Users user = new Users();
user.setPhone(phone);
user.setPassword(password);
user.setNickname(nickname);
user.setIDCard(IDCard);
user.setName(name);
<<<<<<< HEAD
user.setCreatetime((currentTime.getYear()+"-"+currentTime.getMonthValue()+"-"+currentTime.getDayOfMonth()));
=======
user.setCreatetime((currentTime.getYear() + "-" + currentTime.getMonthValue() + "-" + currentTime.getDayOfMonth()));
>>>>>>> zhanglinhao_branch
user.setGender(isMale(IDCard));
usersService.add(user);
return 1004;//注册成功
}
}
<<<<<<< HEAD
boolean isMale(String IDCard){
System.out.println("根据身份证判断性别:"+IDCard+" 第17位:"+IDCard.charAt(16));
return (int)IDCard.charAt(16) % 2 != 0;
=======
boolean isMale(String IDCard) {
System.out.println("根据身份证判断性别:" + IDCard + " 第17位:" + IDCard.charAt(16));
return (int) IDCard.charAt(16) % 2 != 0;
>>>>>>> zhanglinhao_branch
}
}

@ -0,0 +1,9 @@
1000->1 登录成功
1001->2 密码或账号错误
1002->3 该账户未注册
1003->4 该账户已经注册
1004->5 注册成功
1005->6 未输入账号密码
1006->7 未输入账号
1007->8 身份证输入错误
1008->9

@ -0,0 +1,41 @@
package com.softegg.freetogo.SendDemand.controller;
import com.softegg.freetogo.SendDemand.service.SendDemandService;
import com.softegg.freetogo.Demand.Dao.DemandsRepository;
import com.softegg.freetogo.Demand.bean.Demands;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* @description:
* @author:wuyifan
* @date:2024/5/10 23:09
*/
@RestController
//@CrossOrigin(origins = "*")
@RequestMapping("/SendDemand")
public class SendDemandController {
@Autowired
SendDemandService sendDemandService;
/**
* @description:
* @param: map
* @return: java.lang.String
* @author: zhanglinhao
* @date: 2024/5/9 22:45
*/
@PostMapping("register")
public int SendDemand(@RequestBody Map<String, Object> map) {
return switch (sendDemandService.sendnewDemandAccount(map.get("city").toString(), map.get("phone").toString())){
case 1005 -> 1;//需求发送成功
default -> 0;
};
}
}

@ -0,0 +1,13 @@
package com.softegg.freetogo.SendDemand.service;
import org.springframework.stereotype.Service;
/**
* @description:
* @author:wuyifan
* @date:2024/5/10 23:31
*/
@Service
public interface SendDemandService {
int sendnewDemandAccount(String city, String phone);
}

@ -0,0 +1,39 @@
package com.softegg.freetogo.SendDemand.service;
import com.softegg.freetogo.Demand.bean.Demands;
import com.softegg.freetogo.Demand.service.DemandsService;
import com.softegg.freetogo.User.service.UsersService;
import com.softegg.freetogo.User.bean.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @description:
* @author:wuyifan
* @date:2024/5/10 23:10
*/
@Component
public class SendDemandServiceImpl implements SendDemandService {
@Autowired
DemandsService demandsService;
UsersService usersService;
/**
* @description:
* @param: city
* @return: int
* @author: wuyifan
* @date: 2024/5/10 23:25
*/
@Override
public int sendnewDemandAccount(String city, String phone) {
Demands demand = new Demands();
Users user = usersService.getUserByPhone(phone);
demand.setPhone(phone);
demand.setCity(city);
demand.setTouristGender(user.isGender());
demand.setNickname(user.getNickname());
demandsService.add(demand);
return 1005;//添加需求成功
}
}

@ -12,7 +12,7 @@ import lombok.Setter;
* @date:2024/5/7 15:36 * @date:2024/5/7 15:36
*/ */
@Entity @Entity
@Table(name="users") @Table(name = "users")
@Setter @Setter
@Getter @Getter
@NoArgsConstructor @NoArgsConstructor
@ -43,4 +43,18 @@ public class Users {
private String nickname; private String nickname;
@Column @Column
private int status; private int status;
public Users(String name, String email, String psw, String ct, int rpt, String phone, String nkn, String idc, boolean gender, boolean type, int status) {
this.name = name;
this.email = email;
this.password = psw;
this.createtime = ct;
this.reputation = rpt;
this.phone = phone;
this.nickname = nkn;
this.IDCard = idc;
this.gender = gender;
this.membertype = type;
this.status = status;
}
} }

@ -0,0 +1,217 @@
package com.softegg.freetogo.User.controller;
import com.softegg.freetogo.User.bean.Users;
import com.softegg.freetogo.User.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
* @description:Users
* @author:zhanglinhao
* @date:2024/5/8 8:28
*/
@RestController
//@CrossOrigin(origins = "*")
@RequestMapping("/Users")
public class UsersController {
@Autowired
private UsersService usersService;
/**
* @description: users
* @param: null
* @return: java.util.List<com.softegg.freetogo.User.bean.Users>
* @author: zhanglinhao
* @date: 2024/5/10 8:16
*/
@GetMapping("findAll")
public List<Users> findAll() {
System.out.println("响应查找所有数据");
return usersService.findAll();
}
/**
* @description:
* @param: name
* @param: email
* @param: psw
* @param: ct
* @param: rpt
* @param: phone
* @param: nkn
* @param: idc
* @param: gender
* @param: type
* @param: status
* @return: java.lang.String
* @author: zhanglinhao
* @date: 2024/5/10 8:17
*/
@GetMapping("add")
public String add(String name,
String email,
String password,
String createtime,
int reputation,
String phone,
String nickname,
String IDCard,
boolean gender,
boolean type,
int status) {
Users user = new Users(name, email, password, createtime, reputation, phone, nickname, IDCard, gender, type, status);
usersService.add(user);
System.out.println("添加用户");
return "添加成功";
}
/**
* @description: id
* @param: id
* @return: java.lang.String
* @author: zhanglinhao
* @date: 2024/5/10 8:17
*/
@GetMapping("delbyid")
public String delById(int id) {
usersService.deleteById(id);
System.out.println("通过id删除用户");
return "删除成功";
}
/**
* @description: id
* @param: id
* @return: com.softegg.freetogo.User.bean.Users
* @author: zhanglinhao
* @date: 2024/5/10 8:17
*/
@GetMapping("findbyid")
public Users getUserById(int id) {
System.out.println("通过id获取用户数据");
return usersService.getUserById(id);
}
/**
* @description: 使GET
* @param: name
* @param: email
* @param: password
* @param: ct
* @param: rpt
* @param: phone
* @param: nkn
* @param: idc
* @param: gender
* @param: type
* @param: status
* @return: java.lang.String
* @author: zhanglinhao
* @date: 2024/5/10 8:17
*/
@GetMapping("update")
public String update(String name,
String email,
String password,
String createtime,
int reputation,
String phone,
String nickname,
String IDCard,
boolean gender,
boolean type,
int status) {
Users User = usersService.getUserByPhone(phone);
System.out.println(User);
setUsers(name, email, password, createtime, reputation, phone, nickname, IDCard, gender, type, status, User);
usersService.update(User);
System.out.println("更新用户信息:" + User);
return "更新成功";
}
/**
* @description: 使POST
* @param: user
* @return: void
* @author: zhanglinhao
* @date: 2024/5/10 19:45
*/
@PostMapping("pupdate")
public boolean pupdate(@RequestBody Map<String, Map<String, Object>> user) {
Map<String, Object> ubody = user.get("user");
// System.out.println(ubody);
// System.out.println(ubody.get("uid"));
Users User = new Users((int) ubody.get("uid"), (String) ubody.get("name"), (String) ubody.get("email"), (String) ubody.get("password"), (String) ubody.get("createtime"), (String) ubody.get("IDCard"), (int) ubody.get("reputation"), (boolean) ubody.get("gender"), (boolean) ubody.get("membertype"), (String) ubody.get("phone"), (String) ubody.get("nickname"), (int) ubody.get("status"));
usersService.update(User);
return true;
}
@PostMapping("Pupdate")
public boolean Pupdate(@RequestBody Map<String, Users> user) {
Users ubody = user.get("user");
System.out.println(ubody);
// System.out.println(ubody.get("uid"));
Users User = new Users(ubody.getUid(), ubody.getName(), ubody.getEmail(), ubody.getPassword(), ubody.getCreatetime(), ubody.getIDCard(), ubody.getReputation(), ubody.isGender(), ubody.isMembertype(), ubody.getPhone(), ubody.getNickname(), ubody.getStatus());
usersService.update(User);
return true;
}
/**
* @description:
* @param: phone
* @return: com.softegg.freetogo.User.bean.Users
* @author: zhanglinhao
* @date: 2024/5/10 8:17
*/
@GetMapping("getByPhone")
public Users getByPhone(String phone) {
System.out.println("根据手机号获取用户信息:" + phone);
return usersService.getUserByPhone(phone);
}
/**
* @description: user
* @param: name
* @param: email
* @param: psw
* @param: ct
* @param: rpt
* @param: phone
* @param: nkn
* @param: idc
* @param: gender
* @param: type
* @param: status
* @param: user
* @return: void
* @author: zhanglinhao
* @date: 2024/5/10 8:18
*/
private void setUsers(String name,
String email,
String psw,
String ct,
int rpt,
String phone,
String nkn,
String idc,
boolean gender,
boolean type,
int status,
Users user) {
user.setName(name);
user.setGender(gender);
user.setPassword(psw);
user.setEmail(email);
user.setReputation(rpt);
user.setMembertype(type);
user.setCreatetime(ct);
user.setPhone(phone);
user.setNickname(nkn);
user.setIDCard(idc);
user.setStatus(status);
}
}

@ -8,9 +8,9 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
/** /**
* @description: * @description:
* @author:zhanglinhao * @author: zhanglinhao
* @date:2024/5/8 8:50 * @date: 2024/5/8 8:50
*/ */
@Component @Component
public class UserServiceImpl implements UsersService { public class UserServiceImpl implements UsersService {
@ -38,7 +38,7 @@ public class UserServiceImpl implements UsersService {
*/ */
public void add(Users user) { public void add(Users user) {
usersRepository.save(user); usersRepository.save(user);
System.out.println("添加成功"); System.out.println("添加成功:" + user);
} }
/** /**
@ -50,7 +50,7 @@ public class UserServiceImpl implements UsersService {
*/ */
public void deleteById(int id) { public void deleteById(int id) {
usersRepository.deleteById(id); usersRepository.deleteById(id);
System.out.println("删除成功"); System.out.println("删除成功:" + id);
} }
/** /**
@ -73,7 +73,7 @@ public class UserServiceImpl implements UsersService {
*/ */
public void update(Users user) { public void update(Users user) {
usersRepository.save(user); usersRepository.save(user);
System.out.println("更新成功"); System.out.println("更新成功:" + user);
} }
/** /**
@ -85,7 +85,7 @@ public class UserServiceImpl implements UsersService {
*/ */
public boolean isRegister(String phone) { public boolean isRegister(String phone) {
Users users = usersRepository.findByPhone(phone); Users users = usersRepository.findByPhone(phone);
System.out.println(users); System.out.println("正在验证用户是否注册:" + users);
return users != null; return users != null;
} }
@ -97,6 +97,7 @@ public class UserServiceImpl implements UsersService {
* @date: 2024/5/9 22:55 * @date: 2024/5/9 22:55
*/ */
public Users getUserByPhone(String phone) { public Users getUserByPhone(String phone) {
System.out.println("通过手机号查找用户:" + phone);
return usersRepository.findByPhone(phone); return usersRepository.findByPhone(phone);
} }
} }

@ -1,6 +1,7 @@
package com.softegg.freetogo.User.service; package com.softegg.freetogo.User.service;
import com.softegg.freetogo.User.bean.Users; import com.softegg.freetogo.User.bean.Users;
import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
@ -9,7 +10,7 @@ import java.util.List;
* @author:zhanglinhaon * @author:zhanglinhaon
* @date:2024/5/7 16:06 * @date:2024/5/7 16:06
*/ */
@Service
public interface UsersService { public interface UsersService {
List<Users> findAll();//查找所有用户 List<Users> findAll();//查找所有用户

@ -11,7 +11,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
public class helloController { public class helloController {
@GetMapping("/hello") @GetMapping("/hello")
public String hello(){ public String hello() {
return "hello world!"; return "hello world!";
} }
} }

308
src/后端/mvnw vendored

@ -1,308 +0,0 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.2.0
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ] ; then
if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
JAVA_HOME="$(/usr/libexec/java_home)"; export JAVA_HOME
else
JAVA_HOME="/Library/Java/Home"; export JAVA_HOME
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$JAVA_HOME" ] && [ -d "$JAVA_HOME" ] &&
JAVA_HOME="$(cd "$JAVA_HOME" || (echo "cannot cd into $JAVA_HOME."; exit 1); pwd)"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr "\"$javaExecutable\"" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! "$(expr "$readLink" : '\([^ ]*\)')" = "no" ]; then
if $darwin ; then
javaHome="$(dirname "\"$javaExecutable\"")"
javaExecutable="$(cd "\"$javaHome\"" && pwd -P)/javac"
else
javaExecutable="$(readlink -f "\"$javaExecutable\"")"
fi
javaHome="$(dirname "\"$javaExecutable\"")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(\unset -f command 2>/dev/null; \command -v java)"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]
then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ] ; do
if [ -d "$wdir"/.mvn ] ; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(cd "$wdir/.." || exit 1; pwd)
fi
# end of workaround
done
printf '%s' "$(cd "$basedir" || exit 1; pwd)"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
# Remove \r in case we run on Windows within Git Bash
# and check out the repository with auto CRLF management
# enabled. Otherwise, we may read lines that are delimited with
# \r\n and produce $'-Xarg\r' rather than -Xarg due to word
# splitting rules.
tr -s '\r\n' ' ' < "$1"
fi
}
log() {
if [ "$MVNW_VERBOSE" = true ]; then
printf '%s\n' "$1"
fi
}
BASE_DIR=$(find_maven_basedir "$(dirname "$0")")
if [ -z "$BASE_DIR" ]; then
exit 1;
fi
MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}; export MAVEN_PROJECTBASEDIR
log "$MAVEN_PROJECTBASEDIR"
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
wrapperJarPath="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar"
if [ -r "$wrapperJarPath" ]; then
log "Found $wrapperJarPath"
else
log "Couldn't find $wrapperJarPath, downloading it ..."
if [ -n "$MVNW_REPOURL" ]; then
wrapperUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
else
wrapperUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
fi
while IFS="=" read -r key value; do
# Remove '\r' from value to allow usage on windows as IFS does not consider '\r' as a separator ( considers space, tab, new line ('\n'), and custom '=' )
safeValue=$(echo "$value" | tr -d '\r')
case "$key" in (wrapperUrl) wrapperUrl="$safeValue"; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
log "Downloading from: $wrapperUrl"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget > /dev/null; then
log "Found wget ... using wget"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--quiet"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget $QUIET "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget $QUIET --http-user="$MVNW_USERNAME" --http-password="$MVNW_PASSWORD" "$wrapperUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
log "Found curl ... using curl"
[ "$MVNW_VERBOSE" = true ] && QUIET="" || QUIET="--silent"
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl $QUIET -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
else
curl $QUIET --user "$MVNW_USERNAME:$MVNW_PASSWORD" -o "$wrapperJarPath" "$wrapperUrl" -f -L || rm -f "$wrapperJarPath"
fi
else
log "Falling back to using Java to download"
javaSource="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.java"
javaClass="$MAVEN_PROJECTBASEDIR/.mvn/wrapper/MavenWrapperDownloader.class"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaSource=$(cygpath --path --windows "$javaSource")
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaSource" ]; then
if [ ! -e "$javaClass" ]; then
log " - Compiling MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/javac" "$javaSource")
fi
if [ -e "$javaClass" ]; then
log " - Running MavenWrapperDownloader.java ..."
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$wrapperUrl" "$wrapperJarPath") || rm -f "$wrapperJarPath"
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
# If specified, validate the SHA-256 sum of the Maven wrapper jar file
wrapperSha256Sum=""
while IFS="=" read -r key value; do
case "$key" in (wrapperSha256Sum) wrapperSha256Sum=$value; break ;;
esac
done < "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.properties"
if [ -n "$wrapperSha256Sum" ]; then
wrapperSha256Result=false
if command -v sha256sum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | sha256sum -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
elif command -v shasum > /dev/null; then
if echo "$wrapperSha256Sum $wrapperJarPath" | shasum -a 256 -c > /dev/null 2>&1; then
wrapperSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available."
echo "Please install either command, or disable validation by removing 'wrapperSha256Sum' from your maven-wrapper.properties."
exit 1
fi
if [ $wrapperSha256Result = false ]; then
echo "Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised." >&2
echo "Investigate or delete $wrapperJarPath to attempt a clean download." >&2
echo "If you updated your Maven version, you need to update the specified wrapperSha256Sum property." >&2
exit 1
fi
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $*"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
# shellcheck disable=SC2086 # safe args
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

205
src/后端/mvnw.cmd vendored

@ -1,205 +0,0 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.2.0
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set WRAPPER_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET WRAPPER_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET WRAPPER_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %WRAPPER_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%WRAPPER_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM If specified, validate the SHA-256 sum of the Maven wrapper jar file
SET WRAPPER_SHA_256_SUM=""
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperSha256Sum" SET WRAPPER_SHA_256_SUM=%%B
)
IF NOT %WRAPPER_SHA_256_SUM%=="" (
powershell -Command "&{"^
"$hash = (Get-FileHash \"%WRAPPER_JAR%\" -Algorithm SHA256).Hash.ToLower();"^
"If('%WRAPPER_SHA_256_SUM%' -ne $hash){"^
" Write-Output 'Error: Failed to validate Maven wrapper SHA-256, your Maven wrapper might be compromised.';"^
" Write-Output 'Investigate or delete %WRAPPER_JAR% to attempt a clean download.';"^
" Write-Output 'If you updated your Maven version, you need to update the specified wrapperSha256Sum property.';"^
" exit 1;"^
"}"^
"}"
if ERRORLEVEL 1 goto error
)
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%

@ -1,95 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.5</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.SoftEgg</groupId>
<artifactId>FreeToGo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>FreeToGo</name>
<description>FreeToGo</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>3.0.3</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter-test</artifactId>
<version>3.0.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<version>3.2.5</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>3.2.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>

@ -1,42 +0,0 @@
package com.softegg.freetogo.Login;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* @description:
* @author:zhanglinhao
* @date:2024/5/9 9:35
*/
@RestController
//@CrossOrigin(origins = "*")
@RequestMapping("/Login")
public class LoginController {
@Autowired
LoginService loginService;
@PostMapping("login")
public String Login(@RequestBody Map<String,Object> map){
System.out.println(map);
System.out.println(map.get("username").toString());
System.out.println(map.get("password").toString());
return switch (loginService.loginAccount( map.get("username").toString(), map.get("password").toString())) {
case 1000 -> "登陆成功";
case 1001 -> "密码错误";
case 1002 -> "未注册";
default -> null;
};
}
@PostMapping("register")
public String Register(@RequestBody Map<String,Object> map){
return switch (loginService.registerAccount(map.get("username").toString(), map.get("password").toString())) {
case 1003 -> "已注册";
case 1004 -> "注册成功";
default -> null;
};
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save