Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quantum-blocks-h5
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
quantum-blocks-h5
Commits
2a905841
Commit
2a905841
authored
Oct 18, 2022
by
Xuguangxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 处理时区偏移问题
parent
e11d5b46
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
+16
-14
activity.ts
app/controller/activity.ts
+3
-1
apollo.json
config/apollo.json
+11
-11
apollo.ssr.json
config/apollo.ssr.json
+1
-1
package.json
package.json
+1
-1
No files found.
app/controller/activity.ts
View file @
2a905841
import
{
Controller
,
Context
}
from
'
egg
'
;
import
{
off
}
from
'
process
'
;
export
default
class
ActivityController
extends
Controller
{
public
async
home
(
ctx
:
Context
)
{
...
...
@@ -7,7 +8,8 @@ export default class ActivityController extends Controller {
let
body
=
''
;
// 获取服务器端当前时间,用于与页面有效期做对比
const
currentTime
=
new
Date
().
getTime
();
const
offsetTime
=
new
Date
(
currentTime
).
getTimezoneOffset
();
const
offsetTime
=
new
Date
(
currentTime
).
getTimezoneOffset
()
*
60
*
1000
;
// console.log(currentTime, offsetTime);
const
serverTimeStamp
=
currentTime
-
offsetTime
;
if
(
process
.
env
.
NODE_ENV
===
'
development
'
)
{
...
...
config/apollo.json
View file @
2a905841
{
"api"
:
{
"apiHost"
:
"https://quantum-blocks-
ds
.liangkebang.net"
,
"h5Host"
:
"https://quantum-h5-
ds
.liangkebang.net"
,
"opapiHost"
:
"https://opapi-
ds
.liangkebang.net"
,
"passportHost"
:
"https://passportapi-
ds
.liangkebang.net"
,
"talosHost"
:
"https://talos-
ds
.liangkebang.net"
,
"kdspHost"
:
"https://kdsp-api-
ds
.liangkebang.net"
,
"apiHost"
:
"https://quantum-blocks-
toc
.liangkebang.net"
,
"h5Host"
:
"https://quantum-h5-
toc
.liangkebang.net"
,
"opapiHost"
:
"https://opapi-
toc
.liangkebang.net"
,
"passportHost"
:
"https://passportapi-
toc
.liangkebang.net"
,
"talosHost"
:
"https://talos-
toc
.liangkebang.net"
,
"kdspHost"
:
"https://kdsp-api-
toc
.liangkebang.net"
,
"loginUrl"
:
""
,
"newApolloFlag"
:
true
,
"h5ShopHost"
:
"https://tenet-
ds
.liangkebang.net/#"
,
"mallHost"
:
"https://mall-
ds
.liangkebang.net"
,
"xyqbH5Host"
:
"https://mapi-
ds
.liangkebang.net"
,
"h5ShopHost"
:
"https://tenet-
toc
.liangkebang.net/#"
,
"mallHost"
:
"https://mall-
toc
.liangkebang.net"
,
"xyqbH5Host"
:
"https://mapi-
toc
.liangkebang.net"
,
"yxmTenantId"
:
560761
,
"appIdMap"
:
{
"560761"
:
"wxe16bf9293671506c"
,
...
...
@@ -18,8 +18,8 @@
}
},
"redis"
:
{
"port"
:
"3
1980
"
,
"host"
:
"172.16.4.
7
"
,
"port"
:
"3
0895
"
,
"host"
:
"172.16.4.
89
"
,
"password"
:
""
,
"db"
:
0
},
...
...
config/apollo.ssr.json
View file @
2a905841
{
"apiHost"
:
"https://quantum-blocks-ds.liangkebang.net","h5Host"
:
"https://quantum-h5-ds.liangkebang.net","opapiHost"
:
"https://opapi-ds.liangkebang.net","passportHost"
:
"https://passportapi-ds.liangkebang.net","talosHost"
:
"https://talos-ds.liangkebang.net","kdspHost"
:
"https://kdsp-api-ds.liangkebang.net","loginUrl"
:
"","newApolloFlag"
:
true
,
"h5ShopHost"
:
"https://tenet-ds.liangkebang.net/#","mallHost"
:
"https://mall-ds.liangkebang.net","xyqbH5Host"
:
"https://mapi-ds.liangkebang.net","yxmTenantId"
:
560761
,
"appIdMap"
:{
"560761"
:
"wxe16bf9293671506c","560867"
:
"wxccb8435d68e8c7d6"},"qiniuUpHost"
:
"https://up-z0.qiniup.com","qiniuHost"
:
"https://appsync.lkbang.net"
}
\ No newline at end of file
{
"apiHost"
:
"https://quantum-blocks-toc.liangkebang.net","h5Host"
:
"https://quantum-h5-toc.liangkebang.net","opapiHost"
:
"https://opapi-toc.liangkebang.net","passportHost"
:
"https://passportapi-toc.liangkebang.net","talosHost"
:
"https://talos-toc.liangkebang.net","kdspHost"
:
"https://kdsp-api-toc.liangkebang.net","loginUrl"
:
"","newApolloFlag"
:
true
,
"h5ShopHost"
:
"https://tenet-toc.liangkebang.net/#","mallHost"
:
"https://mall-toc.liangkebang.net","xyqbH5Host"
:
"https://mapi-toc.liangkebang.net","yxmTenantId"
:
560761
,
"appIdMap"
:{
"560761"
:
"wxe16bf9293671506c","560867"
:
"wxccb8435d68e8c7d6"},"qiniuUpHost"
:
"https://up-z0.qiniup.com","qiniuHost"
:
"https://appsync.lkbang.net"
}
\ No newline at end of file
package.json
View file @
2a905841
...
...
@@ -8,7 +8,7 @@
"test"
:
"cross-env NODE_ENV=production EGG_SERVER_ENV=sit egg-scripts start --port 80 --workers 1"
,
"stop"
:
"egg-scripts stop"
,
"backend"
:
"nohup egg-scripts start --port 7001 --workers 4"
,
"dev"
:
"cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=
ds
npm run apollo && egg-bin dev -r egg-ts-helper/register"
,
"dev"
:
"cross-env NODE_ENV=test APOLLO_CLUSTER=k8s NAMESPACE=
toc
npm run apollo && egg-bin dev -r egg-ts-helper/register"
,
"debug"
:
"egg-bin debug -r egg-ts-helper/register"
,
"apollo"
:
"node bin/apollo.js"
,
"build"
:
"cross-env NODE_ENV=production APOLLO_CLUSTER=3C npm run apollo && cross-env COS_ENV=production easy build --devtool"
,
...
...
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