Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mongo-ui
Commits
88528118
Commit
88528118
authored
Sep 01, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/goods' into 'master'
fix: 问题修复 See merge request
!188
parents
4a493179
9c46aca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
+5
-8
http.js
src/service/http.js
+3
-6
wxJsSdk.js
src/service/wxJsSdk.js
+2
-2
No files found.
src/service/http.js
View file @
88528118
...
@@ -5,7 +5,6 @@ import axios from "axios";
...
@@ -5,7 +5,6 @@ import axios from "axios";
import
cherry
from
"
@qg/cherry-ui
"
;
import
cherry
from
"
@qg/cherry-ui
"
;
import
config
from
"
../config
"
;
import
config
from
"
../config
"
;
import
localStorage
from
"
./localStorage
"
;
import
localStorage
from
"
./localStorage
"
;
import
{
debounce
}
from
"
lodash-es
"
;
const
ERR_MESSAGE_MAP
=
{
const
ERR_MESSAGE_MAP
=
{
status
:
{
status
:
{
...
@@ -32,9 +31,6 @@ axios.defaults.timeout = 30000;
...
@@ -32,9 +31,6 @@ axios.defaults.timeout = 30000;
const
wait
=
async
seconds
=>
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
seconds
));
const
wait
=
async
seconds
=>
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
seconds
));
let
showLoading
=
debounce
(
function
()
{
beforeRequest
();
},
3000
);
function
beforeRequest
()
{
function
beforeRequest
()
{
reqNum
++
;
reqNum
++
;
store
.
dispatch
(
"
setIsLoading
"
,
true
);
store
.
dispatch
(
"
setIsLoading
"
,
true
);
...
@@ -54,7 +50,7 @@ function clearRequest() {
...
@@ -54,7 +50,7 @@ function clearRequest() {
// 请求拦截器
// 请求拦截器
axios
.
interceptors
.
request
.
use
(
axios
.
interceptors
.
request
.
use
(
config
=>
{
config
=>
{
showLoading
();
beforeRequest
();
// 发起请求时,取消掉当前正在进行的相同请求
// 发起请求时,取消掉当前正在进行的相同请求
if
(
pending
[
config
.
url
])
{
if
(
pending
[
config
.
url
])
{
...
@@ -78,7 +74,7 @@ axios.interceptors.request.use(
...
@@ -78,7 +74,7 @@ axios.interceptors.request.use(
axios
.
interceptors
.
response
.
use
(
axios
.
interceptors
.
response
.
use
(
response
=>
{
response
=>
{
afterRequest
();
afterRequest
();
showLoading
.
cancel
();
delete
pending
[
response
.
config
.
url
];
delete
pending
[
response
.
config
.
url
];
if
(
response
.
data
.
code
===
"
0
"
)
return
response
.
data
.
data
;
if
(
response
.
data
.
code
===
"
0
"
)
return
response
.
data
.
data
;
// 特殊处理,下单已存在时,跳转到保单列表
// 特殊处理,下单已存在时,跳转到保单列表
...
@@ -91,6 +87,7 @@ axios.interceptors.response.use(
...
@@ -91,6 +87,7 @@ axios.interceptors.response.use(
return
Promise
.
reject
(
response
.
data
);
return
Promise
.
reject
(
response
.
data
);
},
},
async
err
=>
{
async
err
=>
{
console
.
dir
(
err
.
response
);
afterRequest
();
afterRequest
();
// 判断是否取消请求
// 判断是否取消请求
if
(
err
?.
message
===
"
取消重复请求
"
)
{
if
(
err
?.
message
===
"
取消重复请求
"
)
{
...
...
src/service/wxJsSdk.js
View file @
88528118
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* @Description: weixin-js-sdk
* @Description: weixin-js-sdk
* @LastEditors: gzw
* @LastEditors: gzw
* @Date: 20120-08-30 18:40:11
* @Date: 20120-08-30 18:40:11
* @LastEditTime: 2020-09-01 1
8:51:52
* @LastEditTime: 2020-09-01 1
9:06:07
*/
*/
import
cfg
from
"
@/config/index
"
;
import
cfg
from
"
@/config/index
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
import
{
getwxAuth
}
from
"
@/api/user
"
;
...
@@ -70,7 +70,7 @@ export async function setShare({
...
@@ -70,7 +70,7 @@ export async function setShare({
export
function
checkOpenId
()
{
export
function
checkOpenId
()
{
const
openId
=
localStorage
.
get
(
"
openId
"
);
const
openId
=
localStorage
.
get
(
"
openId
"
);
const
local
=
window
.
location
.
href
;
const
local
=
window
.
location
.
href
;
console
.
log
(
openId
,
isWeixinBrower
);
console
.
log
(
!
openId
,
isWeixinBrower
);
if
(
!
openId
&&
isWeixinBrower
)
{
if
(
!
openId
&&
isWeixinBrower
)
{
alert
(
"
无openid
"
);
alert
(
"
无openid
"
);
var
nextPage
=
document
.
createElement
(
"
a
"
);
var
nextPage
=
document
.
createElement
(
"
a
"
);
...
...
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