Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
GeekMiniProgram
Project
Project
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
huanglu
GeekMiniProgram
Commits
8dfd16f0
Commit
8dfd16f0
authored
May 12, 2020
by
huanglu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增util文件夹下内容
parent
03127771
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
14 deletions
+41
-14
index.js
config/index.js
+1
-1
index.js
mock/index.js
+4
-4
app.tsx
src/app.tsx
+3
-9
index.ts
src/utils/index.ts
+18
-0
request.ts
src/utils/request.ts
+15
-0
No files found.
config/index.js
View file @
8dfd16f0
...
...
@@ -82,7 +82,7 @@ const config = {
},
geekProxy
:
{
"/service-profile"
:
{
target
:
"http://192.168.32.35:3000/"
,
//process.env.SERVER_ENDPOINT,
target
:
"http://192.168.32.35:3000/"
,
logLevel
:
"debug"
,
changeOrigoin
:
true
,
},
...
...
mock/index.js
View file @
8dfd16f0
const
cart
=
require
(
'./cart'
)
module
.
exports
=
{
user
:
{
'service-gos'
:
{
'GET /login'
:()
=>
{
return
{
name
:
'huanglu'
...
...
@@ -13,10 +13,9 @@ module.exports = {
}
}
},
common
:
{
'service-user'
:
{
'GET /config'
:
{
version
:
'1.1.10'
}
},
cart
}
}
\ No newline at end of file
src/app.tsx
View file @
8dfd16f0
...
...
@@ -13,16 +13,11 @@ const app = dva.createApp({
const
store
=
app
.
getStore
()
class
App
extends
Component
{
/**
* 指定config的类型声明为: Taro.Config
*
* 由于 typescript 对于 object 类型推导只能推出 Key 的基本类型
* 对于像 navigationBarTextStyle: 'black' 这样的推导出的类型是 string
* 提示和声明 navigationBarTextStyle: 'black' | 'white' 类型冲突, 需要显示声明类型
*/
config
:
Config
=
{
pages
:
[
"pages/index/index"
,
"pages/home/index"
],
subPackages
:
[],
subPackages
:
[
],
preloadRule
:
{},
window
:
{
backgroundTextStyle
:
"light"
,
...
...
@@ -33,7 +28,6 @@ class App extends Component {
};
// 在 App 类中的 render() 函数没有实际作用
// 请勿修改此函数
render
()
{
return
(
<
Provider
store=
{
store
}
>
...
...
src/utils/index.ts
0 → 100644
View file @
8dfd16f0
import
Taro
from
'@tarojs/taro'
const
showLoading
=
(
txt
:
string
,
mask
:
boolean
=
false
)
=>
{
Taro
.
showLoading
({
title
:
txt
,
mask
})
}
const
hideLoading
=
()
=>
{
Taro
.
hideLoading
()
}
export
default
{
showLoading
,
hideLoading
}
\ No newline at end of file
src/utils/request.ts
0 → 100644
View file @
8dfd16f0
export
const
GET
=
(
path
:
string
,
params
:
any
)
=>
{
// TODO
console
.
log
(
path
,
params
)
}
export
const
POST
=
(
path
:
string
,
params
:
any
)
=>
{
// TODO
console
.
log
(
path
,
params
)
}
export
default
{
GET
,
POST
}
\ 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