Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
4637c9f0
Commit
4637c9f0
authored
Nov 30, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权优化
parent
17ad1d24
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
45 additions
and
44 deletions
+45
-44
index.js
c_client/config/index.js
+11
-0
package-lock.json
c_client/package-lock.json
+0
-15
package.json
c_client/package.json
+1
-1
app.config.js
c_client/src/app.config.js
+4
-10
app.js
c_client/src/app.js
+3
-3
config.js
c_client/src/config/config.js
+1
-1
useAuth.js
c_client/src/hooks/useAuth.js
+12
-9
comsTest.config.js
c_client/src/pages/packageComs/comsTest/comsTest.config.js
+7
-0
mdProxy.js
c_client/src/utils/mdProxy.js
+2
-1
yarn.lock
c_client/yarn.lock
+4
-4
No files found.
c_client/config/index.js
View file @
4637c9f0
...
...
@@ -81,6 +81,17 @@ const config = {
generateScopedName
:
'[name]__[local]___[hash:base64:5]'
}
}
},
webpackChain
(
chain
,
webpack
)
{
chain
.
module
.
rule
(
'less'
)
.
pre
()
.
use
(
'style-resources'
)
.
loader
(
'style-resources-loader'
)
.
options
({
patterns
:
path
.
resolve
(
__dirname
,
'../src/styles/index.less'
),
injector
:
'append'
})
}
}
}
...
...
c_client/package-lock.json
View file @
4637c9f0
...
...
@@ -5344,21 +5344,6 @@
"prop-types"
:
"^15.7.2"
}
},
"tbcc-sdk-ts"
:
{
"version"
:
"1.0.13"
,
"resolved"
:
"https://registry.npmjs.org/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.13.tgz"
,
"integrity"
:
"sha512-dupA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626mQ=="
,
"requires"
:
{
"@types/lodash"
:
"^4.14.160"
,
"@types/node"
:
"^14.6.0"
,
"@typescript-eslint/eslint-plugin"
:
"^3.9.1"
,
"@typescript-eslint/parser"
:
"^3.9.1"
,
"eslint"
:
"^7.7.0"
,
"eslint-config-prettier"
:
"^6.11.0"
,
"eslint-plugin-prettier"
:
"^3.1.4"
,
"prettier"
:
"^2.0.5"
}
},
"text-table"
:
{
"version"
:
"0.2.0"
,
"resolved"
:
"https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz"
,
...
...
c_client/package.json
View file @
4637c9f0
...
...
@@ -53,7 +53,7 @@
"react"
:
"^17.0.0"
,
"react-dom"
:
"^17.0.0"
,
"taro-ui"
:
"^3.0.0-alpha.3"
,
"tbcc-sdk-ts"
:
"^1.0.1
3
"
"tbcc-sdk-ts"
:
"^1.0.1
5
"
},
"devDependencies"
:
{
"@babel/core"
:
"^7.8.0"
,
...
...
c_client/src/app.config.js
View file @
4637c9f0
...
...
@@ -23,12 +23,6 @@ export default {
"pages"
:
[
'game/game'
]
},
{
"root"
:
"pages/packageComs"
,
"pages"
:
[
'comsTest/comsTest'
]
}
],
window
:
{
...
...
@@ -42,9 +36,9 @@ export default {
version
:
'*'
,
provider
:
'3000000026642582'
},
memberBenefit
:
{
version
:
'*'
,
provider
:
'3000000043103783'
}
//
memberBenefit: {
//
version: '*',
//
provider: '3000000043103783'
//
}
}
}
\ No newline at end of file
c_client/src/app.js
View file @
4637c9f0
...
...
@@ -13,15 +13,15 @@ const { env, tornadoAPI, defaultActivityId, requestType } = config
cloud
.
init
({
env
})
Taro
.
onError
(
msg
=>
{
Taro
?.
onError
&&
Taro
?
.
onError
(
msg
=>
{
cloundAlarm
(
msg
,
env
,
requestType
)
})
class
App
extends
Component
{
onLaunch
(
options
)
{
console
.
log
(
'options :>> '
,
options
)
const
{
activityId
}
=
options
.
query
||
{}
const
app
=
getApp
()
const
{
activityId
}
=
options
?
.
query
||
{}
const
app
=
Taro
?.
getApp
()
||
{}
app
.
cloud
=
cloud
app
.
tornadoAPI
=
tornadoAPI
app
.
activityId
=
activityId
||
defaultActivityId
...
...
c_client/src/config/config.js
View file @
4637c9f0
export
default
{
env
:
'test'
,
// 云函数环境 test 测试环境 online 线上环境
requestType
:
'
cloud
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
requestType
:
'
yapi
'
,
// cloud: 云函数, yapi: yapi 接口, ams: ams接口,tornadoAPI: 风驰台接口
cloudName
:
'HipPopGame'
,
// 主云函数项目名 CommonToC
sellerId
:
'4004811045'
,
tornadoAPI
:
'https://tornado.duibadev.com.cn/tbServer/api?db=db3000000038851072&proxyIp=172.16.130.158'
,
// 新增:当requestType: 'tornadoAPI'时,找服务端提供地址
...
...
c_client/src/hooks/useAuth.js
View file @
4637c9f0
...
...
@@ -13,18 +13,21 @@ export function useAuth(authSuccess = () => {}) {
const
onHandleSetting
=
useThrottle
(
async
()
=>
{
const
res
=
await
getSetting
()
if
(
!
res
.
authSetting
?.
userInfo
)
{
const
authResult
=
await
authorize
().
catch
(
err
=>
{
setVisible
(
true
)
showToast
({
title
:
'请先授权,授权成功后才可参与活动'
})
completeHandle
.
current
=
true
})
if
(
authResult
)
{
authUserInfo
()
}
await
getAuthorize
()
}
else
{
authUserInfo
()
}
})
const
getAuthorize
=
async
()
=>
{
const
authResult
=
await
authorize
().
catch
(
err
=>
{
setVisible
(
true
)
showToast
({
title
:
'请先授权,授权成功后才可参与活动'
})
completeHandle
.
current
=
true
})
if
(
authResult
)
{
authUserInfo
()
}
}
// 打开授权设置
const
onOpenSetting
=
useThrottle
(
async
()
=>
{
if
(
!
completeHandle
.
current
)
return
;
...
...
@@ -34,7 +37,7 @@ export function useAuth(authSuccess = () => {}) {
// 获取用户授权信息
const
authUserInfo
=
async
()
=>
{
completeHandle
.
current
=
true
const
info
=
await
getAuthUserInfo
()
const
info
=
await
getAuthUserInfo
()
.
catch
(
err
=>
getAuthorize
())
if
(
info
)
{
authSuccess
(
info
)
setVisible
&&
setVisible
(
false
)
...
...
c_client/src/pages/packageComs/comsTest/comsTest.config.js
0 → 100644
View file @
4637c9f0
export
default
{
navigationBarTitleText
:
'游戏页面'
,
enableSkia
:
'true'
,
allowsBounceVertical
:
'NO'
,
enableShareAppMessage
:
true
,
usingComponents
:
{}
}
\ No newline at end of file
c_client/src/utils/mdProxy.js
View file @
4637c9f0
...
...
@@ -10,7 +10,8 @@ const { addStat } = require('../api')
})(
this
,
function
()
{
'use strict'
console
.
log
(
'...proxyMd'
)
const
oldPage
=
Page
return
true
const
oldPage
=
Page
||
{}
const
oldComponent
=
Component
return
(
(
Page
=
function
(
t
)
{
...
...
c_client/yarn.lock
View file @
4637c9f0
...
...
@@ -13894,10 +13894,10 @@ taro-ui@^3.0.0-alpha.3:
lodash "^4.17.10"
prop-types "^15.7.2"
tbcc-sdk-ts@^1.0.1
3
:
version "1.0.1
3
"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
3.tgz#179c6c7f8529a4b146c73a651f529aa56345b6fa
"
integrity sha512-d
upA8ug1zz1/tfVw2ifOoNBlI6te9EXbtSHlsxycNDQxrykCSMP8objFujLeWUajrqNXbUoJlmV2JqbwU626m
Q==
tbcc-sdk-ts@^1.0.1
5
:
version "1.0.1
5
"
resolved "https://registry.yarnpkg.com/tbcc-sdk-ts/-/tbcc-sdk-ts-1.0.1
5.tgz#08ef923b2376f35f99f2df7aab65c76d9cd0c6fd
"
integrity sha512-d
4wz5cOTBbtWmYVl/3dvVjqFEsnnDK+Sp3RPqWEJPA86Kp8ra2Krox8VAIG78amPo8z9KG2ZioGXhxlufUpT8
Q==
optionalDependencies:
"@types/lodash" "^4.14.160"
"@types/node" "^14.6.0"
...
...
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