Commit 8d4d8b90 by 李宁

登录接口调试完成

1 parent c49bbe44
# 接口文档调研记录
## 1. 后台管理 (Backend Management)
主要涉及系统的基础配置、工单提交及各类数据的统计与导出。
| Method | URL | Description | Request Parameters (Key) |
| :--- | :--- | :--- | :--- |
| POST | `/zhijian/opt/unCheckByOpt` | 淮安工维质检-无法质检提交 | `[applyId, uncheckReason]` |
| POST | `/zhijian/opt/setRtcType` | RTC类型切换 - 声网/LiveKit | `[type]` |
| POST | `/zhijian/opt/queryVideoList` | 查询视频列表 | `[callId, applyId]` |
| POST | `/zhijian/opt/getSNStatisticsSummary` | 获取串号统计汇总数据 | `[startDate, endDate, province, areaType]` |
| POST | `/zhijian/opt/getProcessTotalStatistics` | 获取环节总次数及平均值统计 | `[startDate, endDate, province, areaType]` |
| POST | `/zhijian/opt/getProcessRecognizeStatistics` | 获取设备识别次数统计 | `[startDate, endDate, province, areaType]` |
| POST | `/zhijian/opt/getNoShowProcessStatistics` | 获取无法拍摄设备统计数据 | `[startDate, endDate, province, areaType]` |
| POST | `/zhijian/opt/getNoShowCityStatistics` | 获取无法拍摄地市统计数据 | `[startDate, endDate, province, areaType]` |
| POST | `/zhijian/opt/getAllStatisticsByCity` | 获取整体质检工单数据统计(地市及耗时) | `[startDate, endDate, province, areaType]` |
| GET | `/zhijian/opt/exportSnData` | 导出大模型识别结果到Excel | - |
| GET | `/zhijian/opt/exportSNStatistics` | 导出串号统计数据到Excel | - |
| GET | `/zhijian/opt/exportNoShowProcessStatistics` | 导出无法拍摄设备统计数据到Excel | - |
| GET | `/zhijian/opt/exportNoShowGoupByAreaType` | 导出各地市不能拍详情到Excel | - |
| GET | `/zhijian/opt/exportNoShowCityStatistics` | 导出无法拍摄地市统计数据到Excel | - |
| GET | `/zhijian/opt/exportAllStatisticsByCity` | 导出整体质检工单数据统计到Excel | - |
| GET | `/zhijian/opt/downloadNoShowList` | 导出各地市不能拍明细到Excel | - |
## 2. 质检明细 (Quality Inspection Details)
主要用于质检业务的操作,包括列表查询、详情查看及标记功能。
**注意:实际接口路径以 `/zhijian/applyInfoDetail/` 开头**
| Method | URL | Description | Request Parameters (Key) |
| :--- | :--- | :--- | :--- |
| POST | `/zhijian/applyInfoDetail/qualityCheckList` | 质检工单列表查询(分页) | `[pageNum, pageSize, accNbr, applyId, orderId, campaignId, areaType, checkStatus, startTime, endTime, noShowNumType, manualInputNumType, cheatNumType, isCheat, sortField, sortOrder]` |
| POST | `/zhijian/applyInfoDetail/markCheat` | 标记/取消标记作弊 | `[applyId, isCheat]` |
| POST | `/zhijian/applyInfoDetail/getProcessDetailList` | 查询流程明细列表(无法拍摄/手动输入/环境异常) | `[applyId]` |
| POST | `/zhijian/applyInfoDetail/getDevicesByApplyId` | 根据applyId查询工单设备列表 | `[applyId]` |
| POST | `/zhijian/applyInfoDetail/getCheatMarkDetail` | 查看作弊标记详情 | `[applyId]` |
| POST | `/zhijian/applyInfoDetail/exportQualityCheckList` | 导出质检工单列表到Excel | - |
| POST | `/zhijian/applyInfoDetail/exportLLMResultList` | 导出LLM结果列表到Excel | - |
| GET | `/zhijian/applyInfoDetail/view` | 在线查看图片或视频 | - |
| GET | `/zhijian/applyInfoDetail/getProcessByApplyId` | 根据applyID查询任务详情 | `[applyId]` |
| GET | `/zhijian/applyInfoDetail/exportNoShowLLMResultByCity` | 导出各地市不能拍详情列表到Excel | - |
| GET | `/zhijian/applyInfoDetail/exportNoShowCityStatistics-all` | 导出各环节不能拍汇总到Excel | - |
## 3. 内部登录 (Internal Login)
| Method | URL | Description | Request Parameters (Key) |
| :--- | :--- | :--- | :--- |
| POST | `/zhijian/login/resetPassword` | 重置密码 | `[adminNum]` |
| POST | `/zhijian/login/modifyPassword` | 修改密码 | - |
| POST | `/zhijian/login/login` | 用户登录 | `[adminNum, password, captchaCode, codeId]` |
| GET | `/zhijian/login/loginOut` | 退出登录 | - |
| GET | `/zhijian/login/getCaptcha` | 获取验证码 | - |
......@@ -61,4 +61,16 @@
3、登录成功后,默认进入"质检工单列表"页面
去掉“个人中心”选项,点击“退出登录”退出到登录页面
\ No newline at end of file
去掉“个人中心”选项,点击“退出登录”退出到登录页面
本项目的接口文档地址:https://testznzl.lgyzpt.com/zhijian/doc.html#/public/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86/unCheckByOpt
打开本地址后,读取左侧菜单栏的“后台管理”、“质检明细”、“内部登录”三个菜单下的相关接口内容,做一个深入的了解,方便后续的接口对接开发
1、vite.config.js中添加接口代理,接口请求域名为https://testznzl.lgyzpt.com/zhijian
2、在api下创建接口请求js,包括登录/质检工单/数据统计
3、添加代理成功后,修改登录逻辑,将点击登录改为真实的接口请求登录:登录成功,保存用户信息,进入质检工单列表页面
;登录失败,提示接口返回的错误信息
登录接口的传参key值错误了,账号是adminNum,修改下
\ No newline at end of file
import request from '../utils/request'
export const loginApi = {
login(data: any) {
return request({
url: '/zhijian/opt/login',
method: 'post',
data
})
},
logout() {
return request({
url: '/zhijian/opt/loginOut',
method: 'get'
})
}
}
export const qualityApi = {
// Quality Check List
getQualityCheckList(data: any) {
return request({
url: '/zhijian/opt/qualityCheckList',
method: 'post',
data
})
},
// Get Process Detail
getProcessDetailList(data: any) {
return request({
url: '/zhijian/opt/getProcessDetailList',
method: 'post',
data
})
}
}
export const statsApi = {
// Overall stats
getAllStatisticsByCity(data: any) {
return request({
url: '/zhijian/opt/getAllStatisticsByCity',
method: 'post',
data
})
},
// SN stats summary
getSNStatisticsSummary(data: any) {
return request({
url: '/zhijian/opt/getSNStatisticsSummary',
method: 'post',
data
})
},
// Device recognize stats
getProcessRecognizeStatistics(data: any) {
return request({
url: '/zhijian/opt/getProcessRecognizeStatistics',
method: 'post',
data
})
},
// No Photo stats
getNoShowCityStatistics(data: any) {
return request({
url: '/zhijian/opt/getNoShowCityStatistics',
method: 'post',
data
})
}
}
import axios from 'axios'
import { ElMessage } from 'element-plus'
const service = axios.create({
baseURL: import.meta.env.VITE_API_URL || '', // Use proxy
timeout: 5000
})
service.interceptors.request.use(
(config) => {
const token = localStorage.getItem('hzMgrtoken')
if (token) {
// Assume token is needed in headers, though login doesn't need it.
// Adjust header key as per actual API requirement later (e.g. Authorization or specific key)
config.headers['x-access-token'] = token
}
return config
},
(error) => {
return Promise.reject(error)
}
)
service.interceptors.response.use(
(response) => {
const res = response.data
// Adjust success code check based on actual API response structure
// Typically 200 or 0 indicates success
if (res.code !== 200 && res.code !== 0) {
ElMessage.error(res.message || 'Error')
return Promise.reject(new Error(res.message || 'Error'))
}
return res
},
(error) => {
ElMessage.error(error.message)
return Promise.reject(error)
}
)
export default service
......@@ -18,16 +18,35 @@ const rules = {
password: [{ required: true, message: '请输入密码', trigger: 'blur' }]
}
import { loginApi } from '../api'
// ...
const handleLogin = async (formEl: any) => {
if (!formEl) return
await formEl.validate((valid: boolean) => {
await formEl.validate(async (valid: boolean) => {
if (valid) {
loading.value = true
setTimeout(() => {
try {
const res = await loginApi.login({
adminNum: loginForm.username,
password: loginForm.password
})
loading.value = false
if(res.code === 200 || res.code === 0) {
ElMessage.success('登录成功')
// Save token if available in res.data or res.token
if(res.data) {
localStorage.setItem('hzMgrtoken', res.data.token || '')
}
router.push('/order-list')
} else {
// Handled by interceptor, but safety check
}
} catch (error) {
loading.value = false
ElMessage.success('登录成功')
router.push('/order-list')
}, 1000)
console.error(error)
}
}
})
}
......
......@@ -4,4 +4,13 @@ import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
server: {
proxy: {
'/zhijian': {
target: 'https://testznzl.lgyzpt.com',
changeOrigin: true,
secure: false
}
}
}
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!