优化bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="flex_box top_right">
|
<div class="flex_box top_right">
|
||||||
<div class="top_right_name">你好,{{name}}</div>
|
<div class="top_right_name">你好,{{name}}</div>
|
||||||
<div @click="goOut" class="top_right_btn">登出</div>
|
<!-- <div @click="goOut" class="top_right_btn">登出</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ Vue.use(Router)
|
|||||||
|
|
||||||
export default new Router({
|
export default new Router({
|
||||||
routes: [
|
routes: [
|
||||||
|
{ path: '/', component: () => import('@/views/dashboard/index'), name: '首页' },
|
||||||
{ path: '/login', component: () => import('@/views/login/index') },
|
{ path: '/login', component: () => import('@/views/login/index') },
|
||||||
{ path: '/404', component: () => import('@/views/404') },
|
{ path: '/404', component: () => import('@/views/404') },
|
||||||
{ path: '/', component: () => import('@/views/dashboard/index'), name: '首页' },
|
|
||||||
{ path: '/manage', component: () => import('@/views/manage/index'), name: '系统管理' },
|
{ path: '/manage', component: () => import('@/views/manage/index'), name: '系统管理' },
|
||||||
{ path: '/user', component: () => import('@/views/user/index'), name: '用户管理' },
|
{ path: '/user', component: () => import('@/views/user/index'), name: '用户管理' },
|
||||||
{ path: '/set', component: () => import('@/views/set/index'), name: '系统配置' }
|
{ path: '/set', component: () => import('@/views/set/index'), name: '系统配置' }
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ const setFormDefault = {
|
|||||||
}
|
}
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
token: getToken(),
|
token: 'getToken()',
|
||||||
name: 'admin',
|
name: 'admin',
|
||||||
avatar:
|
avatar:
|
||||||
'https://image.baidu.com/search/detail?ct=503316480&z=&tn=baiduimagedetail&ipn=d&word=admin&step_word=&lid=8980923753406439282&ie=utf-8&in=&cl=2&lm=-1&st=-1&hd=&latest=©right=&cs=1902119677,258344230&os=3526618670,2431782315&simid=3426573763,123057590&pn=11&rn=1&di=7410818322373017601&ln=1928&fr=&fmq=1730735680169_R&ic=&s=undefined&se=&sme=&tab=0&width=&height=&face=undefined&is=0,0&istype=2&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=1e&objurl=https%3A%2F%2Fclearhub.tech%2Fwp-content%2Fuploads%2F2018%2F11%2F12.png&rpstart=0&rpnum=0&adpicid=0&nojc=undefined&dyTabStr=MCwzLDEsMiwxMyw3LDYsNSwxMiw5',
|
'https://image.baidu.com/search/detail?ct=503316480&z=&tn=baiduimagedetail&ipn=d&word=admin&step_word=&lid=8980923753406439282&ie=utf-8&in=&cl=2&lm=-1&st=-1&hd=&latest=©right=&cs=1902119677,258344230&os=3526618670,2431782315&simid=3426573763,123057590&pn=11&rn=1&di=7410818322373017601&ln=1928&fr=&fmq=1730735680169_R&ic=&s=undefined&se=&sme=&tab=0&width=&height=&face=undefined&is=0,0&istype=2&ist=&jit=&bdtype=0&spn=0&pi=0&gsm=1e&objurl=https%3A%2F%2Fclearhub.tech%2Fwp-content%2Fuploads%2F2018%2F11%2F12.png&rpstart=0&rpnum=0&adpicid=0&nojc=undefined&dyTabStr=MCwzLDEsMiwxMyw3LDYsNSwxMiw5',
|
||||||
roles: ['admin'],
|
roles: ['admin'],
|
||||||
oneLogin: false,
|
oneLogin: true,
|
||||||
// 高级设置
|
// 高级设置
|
||||||
setForm: setFormDefault,
|
setForm: setFormDefault,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -567,71 +567,73 @@ export default {
|
|||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
if (e) {
|
if (e) {
|
||||||
that
|
that.startService()
|
||||||
.$confirm('确定执行开启服务操作吗?', '温馨提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
that.startService()
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
that.serviceLoading = false
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
that
|
that.stopService()
|
||||||
.$confirm('确定执行关闭服务操作吗?', '温馨提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
that.serviceLoading = true
|
|
||||||
that.serviceText = '服务关闭中'
|
|
||||||
that
|
|
||||||
.$runCmd(`bash ${shPath} stop`)
|
|
||||||
.then((res) => {
|
|
||||||
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: false })
|
|
||||||
setTimeout(() => {
|
|
||||||
that.$store.dispatch('chat/closeWebsocket')
|
|
||||||
that.serviceLoading = false
|
|
||||||
that.$message({
|
|
||||||
message: '服务已关闭',
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
}, 500)
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
that.$message({
|
|
||||||
message: err,
|
|
||||||
type: 'error'
|
|
||||||
})
|
|
||||||
that.serviceLoading = false
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
that.serviceLoading = false
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
startService() {
|
startService() {
|
||||||
let that = this
|
let that = this
|
||||||
that.serviceLoading = true
|
|
||||||
that.serviceText = '服务启动中'
|
|
||||||
that
|
that
|
||||||
.$runCmd(`bash ${shPath} start`)
|
.$prompt('请输入管理员密码并点击确定以执行开启服务操作', '温馨提示', {
|
||||||
.then((res) => {
|
confirmButtonText: '确定',
|
||||||
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: true })
|
cancelButtonText: '取消'
|
||||||
setTimeout(() => {
|
|
||||||
that.$store.dispatch('chat/initWebSocket')
|
|
||||||
}, 500)
|
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.then(({ value }) => {
|
||||||
that.$message({
|
that.serviceLoading = true
|
||||||
message: err,
|
that.serviceText = '服务启动中'
|
||||||
type: 'error'
|
that
|
||||||
})
|
.$runCmd(`bash ${shPath} start ${value}`)
|
||||||
|
.then((res) => {
|
||||||
|
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: true })
|
||||||
|
setTimeout(() => {
|
||||||
|
that.$store.dispatch('chat/initWebSocket')
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
that.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
that.serviceLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
that.serviceLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
stopService() {
|
||||||
|
let that = this
|
||||||
|
that
|
||||||
|
.$prompt('请输入管理员密码并点击确定以执行关闭服务操作', '温馨提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消'
|
||||||
|
})
|
||||||
|
.then(({ value }) => {
|
||||||
|
that.serviceLoading = true
|
||||||
|
that.serviceText = '服务关闭中'
|
||||||
|
that
|
||||||
|
.$runCmd(`bash ${shPath} stop ${value}`)
|
||||||
|
.then((res) => {
|
||||||
|
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: false })
|
||||||
|
setTimeout(() => {
|
||||||
|
that.$store.dispatch('chat/closeWebsocket')
|
||||||
|
that.serviceLoading = false
|
||||||
|
that.$message({
|
||||||
|
message: '服务已关闭',
|
||||||
|
type: 'success'
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
that.$message({
|
||||||
|
message: err,
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
that.serviceLoading = false
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
that.serviceLoading = false
|
that.serviceLoading = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user