Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
new_taobao
Project
Project
Details
Activity
Releases
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
wildfirecode13
new_taobao
Commits
2e19bc8d
Commit
2e19bc8d
authored
Sep 23, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
8a803034
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app.js
taobao_mini/client/app.js
+1
-1
request.js
taobao_mini/client/tbcc-sdk/lib/request.js
+4
-4
No files found.
taobao_mini/client/app.js
View file @
2e19bc8d
...
@@ -7,7 +7,7 @@ cloud.init({
...
@@ -7,7 +7,7 @@ cloud.init({
App
({
App
({
requestType
:
'cloud'
,
// yapi,cloud: 云函数
requestType
:
'cloud'
,
// yapi,cloud: 云函数
requestType
:
'
yapi
'
,
// yapi,cloud: 云函数
requestType
:
'
local
'
,
// yapi,cloud: 云函数
cloudName
:
'tmallCat'
,
// 主云函数项目名 tmallCat
cloudName
:
'tmallCat'
,
// 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud
,
cloud
,
...
...
taobao_mini/client/tbcc-sdk/lib/request.js
View file @
2e19bc8d
...
@@ -53,8 +53,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
...
@@ -53,8 +53,8 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const
requestMock
=
()
=>
{
const
requestMock
=
()
=>
{
const
mockUrlPrefix
=
{
const
mockUrlPrefix
=
{
ams
:
'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri='
,
ams
:
'https://ams.dui88.com/server/index.php?g=Web&c=Mock&o=simple&projectID=218&uri='
,
yapi
:
'http://localhost:3000/'
local
:
'http://localhost:3000/'
,
//
yapi: 'https://docs.dui88.com/mock/140/'
yapi
:
'https://docs.dui88.com/mock/140/'
};
};
const
mockUrl
=
null
;
const
mockUrl
=
null
;
const
requestPrefix
=
mockUrl
||
mockUrlPrefix
[
requestType
];
const
requestPrefix
=
mockUrl
||
mockUrlPrefix
[
requestType
];
...
@@ -85,7 +85,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
...
@@ -85,7 +85,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
const
requestCloud
=
()
=>
{
const
requestCloud
=
()
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
cloud
.
function
.
invoke
(
_cloudName
,
params
,
handle
).
then
(
res
=>
{
cloud
.
function
.
invoke
(
_cloudName
,
params
,
handle
).
then
(
res
=>
{
console
.
log
(
'request Cloud callback=>'
,
handle
,
res
,
JSON
.
stringify
(
res
));
console
.
log
(
'request Cloud callback=>'
,
handle
,
res
,
JSON
.
stringify
(
res
));
// console.log('requestCloud', handle, params, res);
// console.log('requestCloud', handle, params, res);
hideMyLoading
();
hideMyLoading
();
if
(
res
&&
res
.
success
)
{
if
(
res
&&
res
.
success
)
{
...
@@ -104,7 +104,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
...
@@ -104,7 +104,7 @@ const request = ({ cloud, cloudName, requestType = 'cloud' }) => {
// console.log('requestCloud', _cloudName, handle, params);
// console.log('requestCloud', _cloudName, handle, params);
// return requestType === 'ams' ? requestAms() : requestCloud();
// return requestType === 'ams' ? requestAms() : requestCloud();
return
(
requestType
===
'ams'
||
requestType
===
'yapi'
)
?
requestMock
()
:
requestCloud
();
return
(
requestType
===
'ams'
||
requestType
===
'yapi'
||
requestType
===
'local'
)
?
requestMock
()
:
requestCloud
();
};
};
};
};
...
...
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