提交 84a34baa 编写于 作者: yma16's avatar yma16

fix:用化名提示文案错误修复

上级 7ac4108d
......@@ -20,7 +20,7 @@ module.exports = {
},
},
"/ws_api/": {
target: "ws://114.116.52.53/",
target: "ws://yongma16.xyz/",
ws: true, //接受websocket请求
changeOrigin: true, //是否允许跨越
chunkOrigins: true,
......
......@@ -24,7 +24,12 @@
</template>
<el-menu-item-group>
<el-submenu index="1-1">
<template slot="title">yma16</template>
<template slot="title"
>yma16
<span v-if="currentUserName">{{
currentUserName
}}</span></template
>
<el-menu-item index="1-1-1">stay hungry</el-menu-item>
<a @click="jumpToEcharts">
<el-menu-item index="1-1-2">echarts</el-menu-item>
......@@ -129,153 +134,160 @@
</template>
<script>
import store from "@/store";
export default {
name: 'App',
data () {
name: "App",
data() {
return {
authSlogan: 'yma16',
authSlogan: "yma16",
chat_flag: false,
msg: 'yma16',
msg: "yma16",
navigate_flag: true,
value: new Date(),
baseUrl: '/api/',
src: 'https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg',
url: '/image/logo/logo.jpg',
baseUrl: "/api/",
src: "https://cube.elemecdn.com/6/94/4d3ea53c084bad6931a56d5158a48jpeg.jpeg",
url: "/image/logo/logo.jpg",
srcList: [
'https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg',
'https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg'
"https://fuss10.elemecdn.com/8/27/f01c15bb73e1ef3793e64e6b7bbccjpeg.jpeg",
"https://fuss10.elemecdn.com/1/8e/aeffeb4de74e2fde4bd74fc7b4486jpeg.jpeg",
],
headerData: ['从现在开始,种一棵树', '从现在开始,种一棵树'],
readCount: 0
}
headerData: ["从现在开始,种一棵树", "从现在开始,种一棵树"],
readCount: 0,
currentUserName: "",
};
},
computed: {
currentUserName: function () {
return store.state.user.userInfo.name;
},
mounted () {
this.addReadCountFun()
this.readCountFun()
},
mounted() {
this.addReadCountFun();
this.readCountFun();
},
methods: {
jumpIpDns: function () {
try {
window.open('https://beian.miit.gov.cn')
window.open("https://beian.miit.gov.cn");
} catch (r) {
window.location.href = 'https://beian.miit.gov.cn'
throw Error(r)
window.location.href = "https://beian.miit.gov.cn";
throw Error(r);
}
},
addReadCountFun: function () {
const that = this
let clientIp = '未知'
const that = this;
let clientIp = "未知";
try {
console.log('ip待定')
console.log("ip待定");
} catch (e) {
console.log(e)
console.log(e);
}
that.$axios
.post(this.baseUrl + 'count/add/', {
ip: clientIp
.post(this.baseUrl + "count/add/", {
ip: clientIp,
})
.then((res) => {
console.log(res)
console.log(res);
})
.catch((e) => {
throw Error(e)
})
throw Error(e);
});
},
readCountFun: function () {
let that = this
let that = this;
that.$axios
.get(that.baseUrl + 'count/get/')
.get(that.baseUrl + "count/get/")
.then((res) => {
this.readCount = res.data.num
this.readCount = res.data.num;
})
.catch((error) => {
console.log(error)
})
console.log(error);
});
},
changeNavigate: function () {
this.navigate_flag = !this.navigate_flag // 取反
this.navigate_flag = !this.navigate_flag; // 取反
},
handleOpen (key, keyPath) {
console.log(key, keyPath)
if (key === '3') {
console.log('打开3号')
this.chat_flag = true
this.onlineWebsocket() // 调用跳转
handleOpen(key, keyPath) {
console.log(key, keyPath);
if (key === "3") {
console.log("打开3号");
this.chat_flag = true;
this.onlineWebsocket(); // 调用跳转
}
if (key === '2-1') {
this.chat_flag = false
this.loginAction() // 调用跳转
if (key === "2-1") {
this.chat_flag = false;
this.loginAction(); // 调用跳转
}
if (key === '2-2') {
this.chat_flag = false
this.registerAction() // 调用跳转
if (key === "2-2") {
this.chat_flag = false;
this.registerAction(); // 调用跳转
}
},
handleClose (key, keyPath) {
console.info(key, keyPath)
if (key === '3') {
this.chat_flag = false
handleClose(key, keyPath) {
console.info(key, keyPath);
if (key === "3") {
this.chat_flag = false;
}
},
jumpRouter: function (params) {
this.$router
.push({
name: `${params}`
name: `${params}`,
})
.catch((error) => {
console.log(error)
})
console.log(error);
});
},
onlineWebsocket: function () {
// console.log(this.$router);
this.$router
.push({
path: '/onlinewebsocket'
path: "/onlinewebsocket",
})
.catch((error) => {
throw Error(error)
})
throw Error(error);
});
},
jumpToEcharts: function () {
// console.log(this.$router);
this.$router
.push({
path: '/bilicom'
path: "/bilicom",
})
.catch((error) => {
console.log(error)
})
console.log(error);
});
},
jumpToAdmin: function () {
this.$router
.push({
path: '/mavoneditor'
path: "/mavoneditor",
})
.catch((error) => {
console.log(error)
})
console.log(error);
});
},
loginAction: function () {
this.$router
.push({
path: '/login'
path: "/login",
})
.catch((error) => {
console.log(error)
})
console.log(error);
});
},
registerAction: function () {
this.$router
.push({
path: '/register'
path: "/register",
})
.catch((error) => {
console.log(error)
})
}
}
}
console.log(error);
});
},
},
};
</script>
<style>
......
......@@ -127,7 +127,7 @@ export default {
// 添加cookie
} else if (res.data.code == 0) {
// alter("失败!" res.data.msg)
that.$message.error('用化名或密码错误');
that.$message.error("用户名或密码错误");
}
})
.catch((error) => {
......
import { loginUser } from '@/service/user.service'
import { loginUser } from "@/service/user.service";
export default {
// 自带命名空间
namespaced: true,
state: {
// 用户账号密码
userInfo: null
userInfo: {
name: null,
password: null,
},
},
getters: {
userInfo: state => { return state.userInfo }
userInfo: (state) => {
return state.userInfo;
},
},
mutations: {
// 配置用户登录信息 userInfo
setUserInfo (state, userInfo) {
state.userInfo = userInfo
}
setUserInfo(state, userInfo) {
state.userInfo = userInfo;
},
},
actions: {
// Promise
loginUserInfo ({ commit }, info) {
console.log('登录认证 store里面', 'info', info)
loginUserInfo({ commit }, info) {
console.log("登录认证 store里面", "info", info);
return new Promise(async (resolve, reject) => {
try {
let data = await loginUser(info)
let data = await loginUser(info);
// 等待登录信息
console.log('返回的post', data)
console.log("返回的post", data);
// 调用 mutation
commit('setUserInfo', data)
resolve(data)
commit("setUserInfo", info);
resolve(data);
} catch (error) {
reject(error)
reject(error);
}
})
}
}
}
});
},
},
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册