add backup and admin dist

This commit is contained in:
xiaomlove
2021-05-02 17:24:05 +08:00
parent a46256e019
commit 1b2a2ecf62
54 changed files with 439 additions and 145 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
<template>
<div class="footer">
<div class="left">Designed By Xiaomlove</div>
<div class="left">NexusPHP v1.6.0-beta5</div>
<div class="right">
<a target="_blank" href="https://nexusphp.org/">nexusphp.org</a>
</div>
+1
View File
@@ -2,6 +2,7 @@ import { createRouter, createWebHashHistory } from 'vue-router'
const router = createRouter({
history: createWebHashHistory(), // hash模式:createWebHashHistoryhistory模式:createWebHistory
base: '/admin/',
routes: [
{
path: '/',
+13 -13
View File
@@ -8,54 +8,54 @@ const api = {
return axios.post('logout');
},
listAllowAgent: (params = {}) => {
return axios.get('agent-allow', {params: params});
return axios.get('agent-allows', {params: params});
},
storeAllowAgent: (params = {}) => {
return axios.post('agent-allow', params);
return axios.post('agent-allows', params);
},
updateAllowAgent: (id, params = {}) => {
return axios.put('agent-allow/' + id, params);
return axios.put('agent-allows/' + id, params);
},
getAllowAgent: (id) => {
return axios.get('agent-allow/' + id);
return axios.get('agent-allows/' + id);
},
deleteAllowAgent: (id) => {
return axios.delete('agent-allow/' + id);
return axios.delete('agent-allows/' + id);
},
listUser: (params = {}) => {
return axios.get('user', {params: params});
return axios.get('users', {params: params});
},
getUser: (id, params = {}) => {
return axios.get('user/' + id, {params: params});
return axios.get('users/' + id, {params: params});
},
getUserBase: (params = {}) => {
return axios.get('user-base', {params: params});
},
storeUser: (params = {}) => {
return axios.post('user', params);
return axios.post('users', params);
},
listUserMatchExams: (params = {}) => {
return axios.get('user-match-exams', {params: params});
},
listExam: (params = {}) => {
return axios.get('exam', {params: params});
return axios.get('exams', {params: params});
},
listExamIndex: (params = {}) => {
return axios.get('exam-indexes', {params: params});
},
storeExam: (params = {}) => {
return axios.post('exam', params);
return axios.post('exams', params);
},
updateExam: (id, params = {}) => {
return axios.put('exam/' + id, params);
return axios.put('exams/' + id, params);
},
getExam: (id) => {
return axios.get('exam/' + id);
return axios.get('exams/' + id);
},
deleteExam: (id) => {
return axios.delete('exam/' + id);
return axios.delete('exams/' + id);
},
listClass: (params = {}) => {
return axios.get('user-classes', {params: params});
+3 -1
View File
@@ -3,7 +3,9 @@ import { ElMessage } from 'element-plus'
import {localGet} from "./index"
import router from '../router/index'
axios.defaults.baseURL = 'http://nexus-php8.tinyhd.net/api'
console.log(import.meta.env)
axios.defaults.baseURL = import.meta.env.VITE_BASE_URL || '/api'
axios.defaults.withCredentials = true
axios.defaults.headers['X-Requested-With'] = 'XMLHttpRequest'
axios.defaults.headers['Content-Type'] = 'application/json'
+12
View File
@@ -31,6 +31,13 @@
</el-radio-group>
</el-form-item>
<el-form-item label="Discovered" prop="is_discovered">
<el-radio-group v-model="formData.is_discovered">
<el-radio :label="0">No</el-radio>
<el-radio :label="1">Yes</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="Begin" prop="begin">
<el-date-picker
v-model="formData.begin"
@@ -108,6 +115,7 @@ export default {
register_time_range: []
},
status: '',
is_discovered: ''
},
rules: {
name: [
@@ -119,6 +127,9 @@ export default {
status: [
{ required: 'true',}
],
is_discovered: [
{ required: 'true',}
],
},
})
onMounted( () => {
@@ -133,6 +144,7 @@ export default {
state.formData.indexes = res.data.indexes
state.formData.filters = res.data.filters
state.formData.status = res.data.status
state.formData.is_discovered = res.data.is_discovered
})
} else {
let res = api.listExamIndex()
+10 -35
View File
@@ -32,7 +32,7 @@
>
</el-table-column>
<el-table-column
label="Index"
label="Indexes"
width="250px"
>
<template #default="scope" >
@@ -51,13 +51,20 @@
</el-table-column>
<el-table-column
label="Target User"
width="400px"
label="Target users"
width="350px"
>
<template #default="scope" >
<p style="white-space: pre-line" v-html="scope.row.filters_formatted"></p>
</template>
</el-table-column>
<el-table-column
prop="is_discovered_text"
label="Discovered"
>
</el-table-column>
<el-table-column
prop="status_text"
label="Status"
@@ -105,19 +112,6 @@ export default {
setup() {
const multipleTable = ref(null)
const router = useRouter()
// const state = reactive({
// loading: false,
// query: {
// page: 1,
// sort_field: 'id',
// sort_type: 'desc'
// },
// tableData: [], // 数据列表
// multipleSelection: [], // 选中项
// total: 0, // 总条数
// currentPage: 1, // 当前页
// pageSize: 10 // 分页大小
// })
const state = useTable()
@@ -125,21 +119,12 @@ export default {
console.log('ExamTable onMounted')
fetchTableData()
})
// 获取轮播图列表
const fetchTableData = async () => {
state.loading = true
let res = await api.listExam(state.query)
renderTableData(res, state)
state.loading = false
}
// const renderTableData = (res) => {
// state.tableData = res.data.data
// state.page = res.data.meta.current_page
// state.total = res.data.meta.total
// state.currentPage = res.data.meta.current_page
// state.pageSize = res.data.meta.per_page
// state.loading = false
// }
const handleAdd = () => {
router.push({ name: 'exam-form' })
}
@@ -152,7 +137,6 @@ export default {
state.query.page = 1;
await fetchTableData()
}
// 选择项
const handleSelectionChange = (val) => {
state.multipleSelection = val
}
@@ -160,14 +144,6 @@ export default {
state.query.page = val
fetchTableData()
}
const handleStatus = (id, status) => {
axios.put(`/goods/status/${status}`, {
ids: id ? [id] : []
}).then(() => {
ElMessage.success('修改成功')
fetchTableData()
})
}
return {
...toRefs(state),
multipleTable,
@@ -177,7 +153,6 @@ export default {
handleDelete,
fetchTableData,
changePage,
handleStatus
}
}
}
+4 -4
View File
@@ -3,7 +3,7 @@
<el-card>
<template #header>
<div class="card-header">
<span>Base Info</span>
<span>Base info</span>
</div>
</template>
<table class="table-base-info">
@@ -59,7 +59,7 @@
<el-card v-if="examInfo">
<template #header>
<div class="card-header">
<span>Exam</span>
<span>Exam on the way</span>
</div>
</template>
<el-row>
@@ -70,11 +70,11 @@
<td>{{examInfo.exam && examInfo.exam.name}}</td>
</tr>
<tr>
<td>Created At</td>
<td>Created at</td>
<td>{{examInfo.created_at}}</td>
</tr>
<tr>
<td>Exam Time</td>
<td>Exam time</td>
<td>{{examInfo.begin}} ~ {{examInfo.end}}</td>
</tr>
<tr>