mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
-- 添加学员
This commit is contained in:
@@ -21,6 +21,7 @@
|
|||||||
"element-resize-detector": "^1.2.4",
|
"element-resize-detector": "^1.2.4",
|
||||||
"html2canvas": "^1.4.1",
|
"html2canvas": "^1.4.1",
|
||||||
"jquery": "^3.6.1",
|
"jquery": "^3.6.1",
|
||||||
|
"json-bigint": "^1.0.0",
|
||||||
"mitt": "^3.0.0",
|
"mitt": "^3.0.0",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.29.4",
|
||||||
"qrcode.vue": "^3.3.3",
|
"qrcode.vue": "^3.3.3",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {reactive, ref, toRefs, watch} from "vue";
|
import {reactive, ref, toRefs, watch} from "vue";
|
||||||
import axios from 'axios';
|
|
||||||
import {getCookie} from "@/api/method";
|
import {getCookie} from "@/api/method";
|
||||||
|
import JSONBigInt from 'json-bigint';
|
||||||
|
|
||||||
|
const JSONBigIntStr = JSONBigInt({ storeAsString: true });
|
||||||
export function useBoeApiPage(_url, params = {}, config = {
|
export function useBoeApiPage(_url, params = {}, config = {
|
||||||
init: true,
|
init: true,
|
||||||
result: res => res.result,
|
result: res => res.result,
|
||||||
@@ -23,6 +23,8 @@ export function useBoeApiPage(_url, params = {}, config = {
|
|||||||
console.log('params', params)
|
console.log('params', params)
|
||||||
state.loading = true
|
state.loading = true
|
||||||
return request(_url, params).then(r => {
|
return request(_url, params).then(r => {
|
||||||
|
console.log(2222222222222)
|
||||||
|
console.log(r)
|
||||||
state.data = config.result(r)
|
state.data = config.result(r)
|
||||||
state.totalPage = config.totalPage(r)
|
state.totalPage = config.totalPage(r)
|
||||||
state.total = config.total(r)
|
state.total = config.total(r)
|
||||||
@@ -136,34 +138,35 @@ export async function request(_url, params) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const body = method !== 'get' ? params || {} : {}
|
const body = method !== 'get' ? params || {} : {}
|
||||||
console.log('token', getCookie('token'))
|
return fetch(url,{
|
||||||
return axios({
|
|
||||||
url,
|
|
||||||
method,
|
method,
|
||||||
headers: {
|
headers:{
|
||||||
token: getCookie('token'),
|
token: getCookie('token'),
|
||||||
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
|
...method !== 'get' ? {'Content-Type': 'application/json'} : {}
|
||||||
},
|
},
|
||||||
baseURL: '',
|
...method !== 'get' ? {body: JSON.stringify(body)} : {}
|
||||||
...method !== 'get' ? {data: JSON.stringify(body)} : {}
|
}).then(res=>{
|
||||||
}).then(resp => resp.data).then(response => {
|
return res.text()
|
||||||
console.log(response)
|
}).then(res=>{
|
||||||
// if (response.status !== 200 && response.code !== 0) {
|
return JSONBigIntStr.parse(res)
|
||||||
// if (response.code === 3 || response.code === 4 || response.code === 100) {
|
|
||||||
// router.push({path: '/login'})
|
|
||||||
// return
|
|
||||||
// } else {
|
|
||||||
// response.showMsg && notification.open({
|
|
||||||
// message: response.showMsg,
|
|
||||||
// duration: 2,
|
|
||||||
// });
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return response
|
|
||||||
}).catch(e => {
|
|
||||||
console.log(2222)
|
|
||||||
console.log(e)
|
|
||||||
// router.push({path: '/login'})
|
|
||||||
})
|
})
|
||||||
|
// return axios({
|
||||||
|
// url,
|
||||||
|
// method,
|
||||||
|
// headers: {
|
||||||
|
// token: getCookie('token'),
|
||||||
|
// ...method !== 'get' ? {'Content-Type': 'application/json'} : {}
|
||||||
|
// },
|
||||||
|
// baseURL: '',
|
||||||
|
// ...method !== 'get' ? {data: JSON.stringify(body)} : {}
|
||||||
|
// }).then(resp => {
|
||||||
|
// return resp.data
|
||||||
|
// }).then(response => {
|
||||||
|
// console.log(response)
|
||||||
|
// return response
|
||||||
|
// }).catch(e => {
|
||||||
|
// console.log(2222)
|
||||||
|
// console.log(e)
|
||||||
|
// // router.push({path: '/login'})
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {computed, defineProps, onMounted, ref, watch} from "vue";
|
import {computed, defineProps, onMounted, ref} from "vue";
|
||||||
import {delStudentList, getStuPage} from "@/api/index1";
|
import {delStudentList, getStuPage} from "@/api/index1";
|
||||||
import CommonStudent from '@/components/student/CommonStudent'
|
import CommonStudent from '@/components/student/CommonStudent'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user