优化bug

This commit is contained in:
24kycj
2024-12-22 00:49:30 +08:00
parent c7a7e16dfa
commit 9afb630902
4 changed files with 64 additions and 62 deletions
@@ -2,7 +2,7 @@
<div>
<div class="flex_box top_right">
<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>
</template>
+1 -1
View File
@@ -5,9 +5,9 @@ Vue.use(Router)
export default new Router({
routes: [
{ path: '/', component: () => import('@/views/dashboard/index'), name: '首页' },
{ path: '/login', component: () => import('@/views/login/index') },
{ path: '/404', component: () => import('@/views/404') },
{ path: '/', component: () => import('@/views/dashboard/index'), name: '首页' },
{ path: '/manage', component: () => import('@/views/manage/index'), name: '系统管理' },
{ path: '/user', component: () => import('@/views/user/index'), name: '用户管理' },
{ path: '/set', component: () => import('@/views/set/index'), name: '系统配置' }
+2 -2
View File
@@ -13,12 +13,12 @@ const setFormDefault = {
}
const user = {
state: {
token: getToken(),
token: 'getToken()',
name: 'admin',
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=&copyright=&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'],
oneLogin: false,
oneLogin: true,
// 高级设置
setForm: setFormDefault,
},
+36 -34
View File
@@ -567,30 +567,53 @@ export default {
// return
// }
if (e) {
that
.$confirm('确定执行开启服务操作吗?', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
that.startService()
} else {
that.stopService()
}
},
startService() {
let that = this
that
.$prompt('请输入管理员密码并点击确定以执行开启服务操作', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消'
})
.then(({ value }) => {
that.serviceLoading = true
that.serviceText = '服务启动中'
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
})
} else {
},
stopService() {
let that = this
that
.$confirm('确定执行关闭服务操作吗?', '温馨提示', {
.$prompt('请输入管理员密码并点击确定执行关闭服务操作', '温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
cancelButtonText: '取消'
})
.then(() => {
.then(({ value }) => {
that.serviceLoading = true
that.serviceText = '服务关闭中'
that
.$runCmd(`bash ${shPath} stop`)
.$runCmd(`bash ${shPath} stop ${value}`)
.then((res) => {
that.$store.dispatch('chat/setDatas', { name: 'workStatus', data: false })
setTimeout(() => {
@@ -613,27 +636,6 @@ export default {
.catch(() => {
that.serviceLoading = false
})
}
},
startService() {
let that = this
that.serviceLoading = true
that.serviceText = '服务启动中'
that
.$runCmd(`bash ${shPath} start`)
.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
})
},
// 执行
handleRun() {