feat:天平连接

This commit is contained in:
houjunxiang
2025-10-10 18:16:14 +08:00
parent 2b50debcd3
commit c8b2d8683e
16 changed files with 182 additions and 622 deletions

View File

@@ -59,7 +59,7 @@
<script setup> <script setup>
import { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue' import { computed, nextTick, onBeforeUnmount, reactive, ref } from 'vue'
import sysApi from '@/nx/api/sys' import nx from '@/nx'
import { aesEncrypt } from './utils/aes' import { aesEncrypt } from './utils/aes'
const props = defineProps({ const props = defineProps({
@@ -196,7 +196,7 @@ function resetState() {
async function loadCaptcha() { async function loadCaptcha() {
loading.value = true loading.value = true
try { try {
const res = await sysApi.getCaptchaCode({ captchaType: props.captchaType }) const res = await nx.$api.sys.getCaptchaCode({ captchaType: props.captchaType })
if (res && (res.repCode === '0000' || res.code === 0)) { if (res && (res.repCode === '0000' || res.code === 0)) {
const data = res.repData || res.data || {} const data = res.repData || res.data || {}
captchaState.originalImageBase64 = data.originalImageBase64 || '' captchaState.originalImageBase64 = data.originalImageBase64 || ''
@@ -292,7 +292,7 @@ async function submitVerification() {
? aesEncrypt(JSON.stringify(point), captchaState.secretKey) ? aesEncrypt(JSON.stringify(point), captchaState.secretKey)
: JSON.stringify(point) : JSON.stringify(point)
const res = await sysApi.verifyCaptcha({ const res = await nx.$api.sys.verifyCaptcha({
captchaType: props.captchaType, captchaType: props.captchaType,
token: captchaState.token, token: captchaState.token,
pointJson: payload pointJson: payload

File diff suppressed because it is too large Load Diff

View File

@@ -64,6 +64,7 @@ const props = defineProps({
} }
}) })
const emit = defineEmits(['update:showPopup'])
// Data // Data
const curSample = ref({}) const curSample = ref({})
const curParameterKey = ref('') const curParameterKey = ref('')
@@ -79,7 +80,7 @@ const getAllIndexes = arr => {
} }
const close = () => { const close = () => {
uni.$emit('sample-detail-popup_close') emit('update:showPopup', false)
} }
const getSampleData = () => { const getSampleData = () => {

View File

@@ -30,5 +30,6 @@ export function getUpgradeBaseUrl() {
return uni.getStorageSync('upgradeBaseUrl') return uni.getStorageSync('upgradeBaseUrl')
} }
export function getWebSocketUrl() { export function getWebSocketUrl() {
return uni.getStorageSync('base_url').replace('/api', '') + '/ws' // return uni.getStorageSync('base_url').replace('/api', '') + '/ws'
return 'ws://localhost:8330'
} }

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ import request from '@/nx/request'
//获取实验室设备 //获取实验室设备
const getDeviceLaboratoryListBy = params => { const getDeviceLaboratoryListBy = params => {
return request({ return request({
url: '/qms/lims/deviceLaboratory/list', url: '/qms/resource/device-infomation/page',
method: 'GET', method: 'GET',
params: { params: {
...params ...params

View File

@@ -1,77 +0,0 @@
import request from '@/nx/request'
// 根据用户id获取计量点
const getMeasurePointByUserId = params => {
return request({
url: '/mas-iot/user-measure-point/listByUserId',
method: 'GET',
params: {
...params
},
custom: {
isApiEncryption: false
}
})
}
// 根据用户id及计量点id获取计量点
const getMeasurePointByUserIdAndMeasurePointId = params => {
return request({
url: '/mas-iot/user-measure-point/findByUserIdAndMeasurePointId',
method: 'GET',
params: {
...params
},
custom: {
isApiEncryption: false
}
})
}
//获取物料信息
const getGoodsListBy = params => {
return request({
url: '/mas-lims/bas-goods/oldGoodsListBy',
method: 'GET',
params: {
...params
},
custom: {
isApiEncryption: false
}
})
}
//获取发货方
const getSellerListBy = params => {
return request({
url: '/mas-lims/bas-businesses/oldSellerListBy',
method: 'GET',
params: {
...params
},
custom: {
isApiEncryption: false
}
})
}
//获取收货方
const getBuyerListBy = params => {
return request({
url: '/mas-lims/bas-businesses/oldBuyerListBy',
method: 'GET',
params: {
...params
},
custom: {
isApiEncryption: false
}
})
}
export default {
getGoodsListBy,
getSellerListBy,
getBuyerListBy,
getMeasurePointByUserId,
getMeasurePointByUserIdAndMeasurePointId
}

View File

@@ -130,6 +130,8 @@ http.interceptors.response.use(
// $store('user').setToken(response.header.authorization || response.header.Authorization) // $store('user').setToken(response.header.authorization || response.header.Authorization)
// } // }
const userStore = $store('user')
const isLogin = userStore.isLogin
response.config.custom.showLoading && closeLoading() response.config.custom.showLoading && closeLoading()
console.log('response', JSON.parse(JSON.stringify(response.data))) console.log('response', JSON.parse(JSON.stringify(response.data)))
@@ -193,6 +195,9 @@ http.interceptors.response.use(
title: msg || response.config.custom.errorMsg, title: msg || response.config.custom.errorMsg,
icon: 'none' icon: 'none'
}) })
if (code === 401) {
userStore.logout(true)
}
} }
if ((code === 0 || code === 200) && response.config.custom.showSuccess) { if ((code === 0 || code === 200) && response.config.custom.showSuccess) {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More