Commit 5bdd0589 by liujinbo

Merge branch 'refs/heads/master' into master_ljb

parents 6affb264 3446a93e
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://hnaelbtest.hnatechnic.com/mocptest/api' //内网
class ServiceLoading {
open (loading) {
open(loading) {
if (loading || loading === '') {
let loadingText = '加载中'
if (typeof loading === 'string' && loading !== '') {
......@@ -17,7 +18,7 @@ class ServiceLoading {
}
}
close (loading) {
close(loading) {
if (loading || loading === '') {
uni.hideLoading()
}
......@@ -85,7 +86,7 @@ export const httpInterceptor = (options) => {
}
// 添加 token 请求头标识
if (userStore.token) {
options.header.Authorization = `Bearer ${ userStore.token }`
options.header.Authorization = `Bearer ${userStore.token}`
}
console.log('接口请求信息:', options)
return options
......@@ -99,7 +100,7 @@ export const http = (options) => {
return new Promise((resolve, reject) => {
uni.request({
...options,
success (res) {
success(res) {
console.log('接口响应结果:', res)
serviceLoading.close(loading)
const statusCode = res.statusCode
......@@ -126,7 +127,7 @@ export const http = (options) => {
reject(res)
}
},
fail (err) {
fail(err) {
serviceLoading.close(loading)
uni.$mocpMessage.error('网络错误,换个网络试试')
reject(err)
......
......@@ -17,8 +17,8 @@
<template #default="{ item }">
<view class="item" @tap="goDetails(item)">
<view class="item-title">
<view class="left grade">
{{ getParamNameByValue('WorkGrade', item.workGrade) }}
<view class="left">
{{ item.machineNumber }}
</view>
<view class="right">
<global-tag type="primary" class="txt">{{ getParamNameByValue('GuaranteeStage', item.guaranteeStage) }}</global-tag>
......@@ -72,8 +72,4 @@ onUnload(() => {
</script>
<style lang="scss" scoped>
@import 'mocpStatic/css/list.scss';
.grade {
font-size: 34rpx;
color: $mocp-primary-6;
}
</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