Commit 3446a93e by pangchong

feat: 内网

parent e3491b67
import useUserStore from 'mocp/store/user' import useUserStore from 'mocp/store/user'
const baseURL = 'https://hna-platform.anyremote.cn' //测试 // const baseURL = 'https://hna-platform.anyremote.cn' //测试
// const baseURL = 'https://moc.hnatechnic.com/api' //生产 // const baseURL = 'https://moc.hnatechnic.com/api' //生产
const baseURL = 'https://hnaelbtest.hnatechnic.com/mocptest/api' //内网
class ServiceLoading { class ServiceLoading {
open (loading) { open(loading) {
if (loading || loading === '') { if (loading || loading === '') {
let loadingText = '加载中' let loadingText = '加载中'
if (typeof loading === 'string' && loading !== '') { if (typeof loading === 'string' && loading !== '') {
...@@ -17,7 +18,7 @@ class ServiceLoading { ...@@ -17,7 +18,7 @@ class ServiceLoading {
} }
} }
close (loading) { close(loading) {
if (loading || loading === '') { if (loading || loading === '') {
uni.hideLoading() uni.hideLoading()
} }
...@@ -85,7 +86,7 @@ export const httpInterceptor = (options) => { ...@@ -85,7 +86,7 @@ export const httpInterceptor = (options) => {
} }
// 添加 token 请求头标识 // 添加 token 请求头标识
if (userStore.token) { if (userStore.token) {
options.header.Authorization = `Bearer ${ userStore.token }` options.header.Authorization = `Bearer ${userStore.token}`
} }
console.log('接口请求信息:', options) console.log('接口请求信息:', options)
return options return options
...@@ -99,7 +100,7 @@ export const http = (options) => { ...@@ -99,7 +100,7 @@ export const http = (options) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.request({ uni.request({
...options, ...options,
success (res) { success(res) {
console.log('接口响应结果:', res) console.log('接口响应结果:', res)
serviceLoading.close(loading) serviceLoading.close(loading)
const statusCode = res.statusCode const statusCode = res.statusCode
...@@ -126,7 +127,7 @@ export const http = (options) => { ...@@ -126,7 +127,7 @@ export const http = (options) => {
reject(res) reject(res)
} }
}, },
fail (err) { fail(err) {
serviceLoading.close(loading) serviceLoading.close(loading)
uni.$mocpMessage.error('网络错误,换个网络试试') uni.$mocpMessage.error('网络错误,换个网络试试')
reject(err) reject(err)
......
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<template #default="{ item }"> <template #default="{ item }">
<view class="item" @tap="goDetails(item)"> <view class="item" @tap="goDetails(item)">
<view class="item-title"> <view class="item-title">
<view class="left grade"> <view class="left">
{{ getParamNameByValue('WorkGrade', item.workGrade) }} {{ item.machineNumber }}
</view> </view>
<view class="right"> <view class="right">
<global-tag type="primary" class="txt">{{ getParamNameByValue('GuaranteeStage', item.guaranteeStage) }}</global-tag> <global-tag type="primary" class="txt">{{ getParamNameByValue('GuaranteeStage', item.guaranteeStage) }}</global-tag>
...@@ -72,8 +72,4 @@ onUnload(() => { ...@@ -72,8 +72,4 @@ onUnload(() => {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import 'mocpStatic/css/list.scss'; @import 'mocpStatic/css/list.scss';
.grade {
font-size: 34rpx;
color: $mocp-primary-6;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment