Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
schedule
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
fengzhaoyu
schedule
Commits
fd27af5b
Commit
fd27af5b
authored
Nov 11, 2020
by
xiexiaoqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: code10200应用开通中异常处理
parent
9646d47b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
11 additions
and
6 deletions
+11
-6
login.js
api/login.js
+4
-0
xFetch.js
api/xFetch.js
+1
-3
index.axml
pages/index/index.axml
+1
-1
index.js
pages/index/index.js
+2
-1
index.axml
template/refresh/index.axml
+3
-1
No files found.
api/login.js
View file @
fd27af5b
let
lock
=
false
;
import
{
alertOnce
}
from
'./xFetch'
;
export
default
async
function
login
()
{
if
(
lock
==
true
)
{
await
waitLockRelease
(
50
);
...
...
@@ -35,6 +37,8 @@ export default async function login() {
});
lock
=
false
;
resolve
(
res
)
}
else
if
(
res
.
data
.
code
==
10200
)
{
alertOnce
(
'应用正在开通中,请稍后再试'
,
reject
,
{
code
:
10200
});
}
else
{
lock
=
false
;
reject
(
res
.
data
);
...
...
api/xFetch.js
View file @
fd27af5b
...
...
@@ -31,8 +31,6 @@ export default function xFetch({ url, method, data, type }) {
}
else
{
if
(
res
.
data
.
code
==
401
)
{
login
();
}
else
if
(
res
.
data
.
code
==
10200
)
{
alertOnce
(
'应用正在开通中,请稍后再试'
,
rejects
,
{
refresh
:
false
});
}
else
{
alertOnce
(
res
.
data
.
msg
||
'请求异常,请重试'
,
rejects
,
res
);
}
...
...
@@ -54,7 +52,7 @@ export default function xFetch({ url, method, data, type }) {
}
let
alert
=
false
;
function
alertOnce
(
content
,
rejects
,
err
)
{
export
function
alertOnce
(
content
,
rejects
,
err
)
{
if
(
alert
==
false
)
{
dd
.
alert
({
content
:
content
,
...
...
pages/index/index.axml
View file @
fd27af5b
<import src="../../template/loading/loading.axml"/>
<import src="../../template/fullScreen/fullScreen.axml"/>
<import src="../../template/refresh/index.axml"/>
<template is="refresh" a:if='{{refresh}}' ></template>
<template is="refresh" a:if='{{refresh}}'
data="{{refreshCode}}"
></template>
<block a:else>
<view hidden="{{$data.tabBarIndex === '1'}}">
<import src="../../template/affairBlank/index.axml"/>
...
...
pages/index/index.js
View file @
fd27af5b
...
...
@@ -289,7 +289,8 @@ create.Page({
if
(
err
&&
err
.
refresh
)
{
this
.
setData
({
loading
:
false
,
refresh
:
true
refresh
:
true
,
refreshCode
:
10200
});
}
});
...
...
template/refresh/index.axml
View file @
fd27af5b
<template name="refresh">
<view class="refresh-bg">
<view>您的网络好像不给力,请重试</view>
<view a:if="{{refreshCode}}">应用正在开通中,请稍后再试</view>
<view a:else>您的网络好像不给力,请重试</view>
<button class="btn refresh-btn" onTap="refresh">刷新</button>
</view>
</template>
\ No newline at end of file
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