2023-12-01版本
This commit is contained in:
parent
2afcad01e6
commit
51bde198f1
|
@ -17,7 +17,6 @@ export default new Vuex.Store({
|
||||||
delToken(state) {
|
delToken(state) {
|
||||||
state.token = ''
|
state.token = ''
|
||||||
localStorage.removeItem("token")//删除token
|
localStorage.removeItem("token")//删除token
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { Message } from "element-ui";
|
||||||
|
|
||||||
//创建axios实例
|
//创建axios实例
|
||||||
const axiosInstance = axios.create({
|
const axiosInstance = axios.create({
|
||||||
baseURL: 'http://localhost:8080', // 设置默认发送地址为后端端口
|
baseURL: 'http://localhost:8887', // 设置默认发送地址为后端端口
|
||||||
});
|
});
|
||||||
|
|
||||||
//添加拦截器,在每次ajax之前都会执行这个操作
|
//添加拦截器,在每次ajax之前都会执行这个操作
|
||||||
|
|
|
@ -215,7 +215,7 @@ export default {
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (response.data.responseStr !== "No") {
|
if (response.data.responseStr !== "No") {
|
||||||
that.$store.commit("setToken", response.data.responseStr);
|
that.$store.commit("setToken", response.data.responseStr);
|
||||||
localStorage.setItem("nickname", that.loginForm.account);
|
localStorage.setItem("account", that.loginForm.account);
|
||||||
that.$router.push({ path: "/home" });
|
that.$router.push({ path: "/home" });
|
||||||
} else {
|
} else {
|
||||||
that.$message.error('账号或密码错误');
|
that.$message.error('账号或密码错误');
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<p>{{ message.nickname }} {{ message.sendTime }}</p>
|
<p>{{ message.nickname }} {{ message.sendTime }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<el-avatar :src="message.pic" class="head"></el-avatar>
|
<el-avatar :src=message.pic class="head"></el-avatar>
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
{{ message.message }}
|
{{ message.message }}
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<el-avatar :src="message.pic" class="head"></el-avatar>
|
<el-avatar :src=message.pic class="head"></el-avatar>
|
||||||
|
|
||||||
<div class="message">
|
<div class="message">
|
||||||
<div class="detail">
|
<div class="detail">
|
||||||
|
@ -59,6 +59,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axiosInstance from '@/store/request';
|
||||||
|
|
||||||
let socket;
|
let socket;
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
|
@ -93,6 +95,7 @@ export default {
|
||||||
if (!this.textarea) {
|
if (!this.textarea) {
|
||||||
this.$message({ type: 'warning', message: "请输入内容" })
|
this.$message({ type: 'warning', message: "请输入内容" })
|
||||||
} else {
|
} else {
|
||||||
|
axiosInstance.get("/interceptor")
|
||||||
this.getDate()
|
this.getDate()
|
||||||
let SendMessage = {
|
let SendMessage = {
|
||||||
nickname: this.myName,
|
nickname: this.myName,
|
||||||
|
@ -114,11 +117,12 @@ export default {
|
||||||
|
|
||||||
init() {
|
init() {
|
||||||
const that = this
|
const that = this
|
||||||
|
axiosInstance.get("/interceptor")
|
||||||
if (typeof (WebSocket) === undefined) {
|
if (typeof (WebSocket) === undefined) {
|
||||||
console.log("您的浏览器不支持WebSocket");
|
console.log("您的浏览器不支持WebSocket");
|
||||||
} else {
|
} else {
|
||||||
console.log("您的浏览器支持WebSocket");
|
console.log("您的浏览器支持WebSocket");
|
||||||
let socketUrl = "ws://localhost:8080/chat/get";
|
let socketUrl = "ws://localhost:8887/chat/get";
|
||||||
if (socket != null) {
|
if (socket != null) {
|
||||||
socket.close();
|
socket.close();
|
||||||
socket = null;
|
socket = null;
|
||||||
|
|
|
@ -32,14 +32,14 @@
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<h2 class="versionText">ChatABC Windows版 1.1.1</h2>
|
<h2 class="versionText">ChatABC Windows版 1.1.1</h2>
|
||||||
<p class="time">发布时间: 2023年11月17号</p>
|
<p class="time">发布时间: 2023年11月17号</p>
|
||||||
<img src="../../assets/img/cool.jpg" class="img">
|
<img :src=headPic class="img">
|
||||||
<br>
|
<br>
|
||||||
<el-button type="primary" round class="button" @click="download">立即下载</el-button>
|
<el-button type="primary" round class="button" @click="download">立即下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<h2 class="versionText">ChatABC Linux版 1.1.1</h2>
|
<h2 class="versionText">ChatABC Linux版 1.1.1</h2>
|
||||||
<p class="time">发布时间: 2023年11月17号</p>
|
<p class="time">发布时间: 2023年11月17号</p>
|
||||||
<img src="../../assets/img/cool.jpg" class="img">
|
<img :src=headPic class="img">
|
||||||
<el-button type="primary" class="button" @click="download" round>立即下载</el-button>
|
<el-button type="primary" class="button" @click="download" round>立即下载</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -47,18 +47,41 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import axiosInstance from "@/store/request";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
myName: "",
|
myName: "",
|
||||||
headPic: require("@/assets/img/cool.jpg"),
|
headPic: "",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.myName = localStorage.getItem("nickname");
|
this.myName = localStorage.getItem("nickname");
|
||||||
|
this.headPic = localStorage.getItem("headPic");
|
||||||
|
console.log(this.headPic);
|
||||||
|
this.init()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
|
|
||||||
|
init() {
|
||||||
|
const that=this
|
||||||
|
axiosInstance.post("/getHead", {
|
||||||
|
account: localStorage.getItem("account"),
|
||||||
|
}).then(function (response) {
|
||||||
|
that.headPic = response.data.pic;
|
||||||
|
that.myName = response.data.username;
|
||||||
|
localStorage.setItem("nickname", response.data.username);
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
|
|
||||||
//下载文件
|
//下载文件
|
||||||
var blob = new Blob(['Hello, this is the content of the file!'], { type: 'text/plain' });
|
var blob = new Blob(['Hello, this is the content of the file!'], { type: 'text/plain' });
|
||||||
var link = document.createElement('a');
|
var link = document.createElement('a');
|
||||||
|
@ -103,6 +126,7 @@ export default {
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropdownMenu {
|
.dropdownMenu {
|
||||||
|
@ -121,16 +145,6 @@ export default {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.el-popper[x-placement^=bottom] .popper__arrow {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.el-icon-arrow-down {
|
|
||||||
font-size: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.headerNav {
|
.headerNav {
|
||||||
background-color: rgb(35, 40, 52);
|
background-color: rgb(35, 40, 52);
|
||||||
// position: relative;
|
// position: relative;
|
||||||
|
@ -250,6 +264,7 @@ export default {
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
margin-left: 190px;
|
margin-left: 190px;
|
||||||
|
@ -260,4 +275,15 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}</style>
|
}
|
||||||
|
</style>
|
||||||
|
<style lang="scss">
|
||||||
|
//style设置为scope时不生效
|
||||||
|
.el-popper[x-placement^=bottom] .popper__arrow {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon-arrow-down {
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue