Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mocp-uniapp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pangchong
mocp-uniapp
Commits
3446a93e
Commit
3446a93e
authored
Jul 31, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 内网
parent
e3491b67
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
src/mocp/utils/http.js
+7
-6
src/pages/modules/mocp/panel/mco/list.vue
+2
-6
No files found.
src/mocp/utils/http.js
View file @
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
)
...
...
src/pages/modules/mocp/panel/mco/list.vue
View file @
3446a93e
...
...
@@ -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
:
34
rpx
;
color
:
$mocp
-
primary
-
6
;
}
<
/style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment