Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
scrm-wx-merchant-activity
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5923c07f
authored
Jul 28, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交代码
1 parent
90924009
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
23 deletions
src/main.js
src/main.js
View file @
5923c07
...
@@ -40,6 +40,23 @@ Vue.prototype.to = function (name, params) {
...
@@ -40,6 +40,23 @@ Vue.prototype.to = function (name, params) {
import
VConsole
from
'vconsole'
import
VConsole
from
'vconsole'
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
let
body
=
document
.
getElementsByTagName
(
'head'
)[
0
],
WXJDK
=
document
.
createElement
(
'script'
),
WWJDK
=
document
.
createElement
(
'script'
),
ISWXWORK
=
false
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
// WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
WWJDK
.
src
=
'//res.wx.qq.com/wwopen/js/jsapi/jweixin-1.0.0.js'
ISWXWORK
=
true
}
window
.
$ISWXWORK
=
ISWXWORK
util
.
setLocalStorage
(
'is_wxwork'
,
ISWXWORK
)
Vue
.
prototype
.
ISWXWORK
=
ISWXWORK
Vue
.
prototype
.
ISMOBILE
=
util
.
isMobileDevice
()
body
.
appendChild
(
WXJDK
)
if
(
WWJDK
.
src
)
body
.
appendChild
(
WWJDK
)
const
isMock
=
[
'prod'
,
'production'
].
includes
(
process
.
env
.
NODE_ENV
)
const
isMock
=
[
'prod'
,
'production'
].
includes
(
process
.
env
.
NODE_ENV
)
fetchConfig
(
!
isMock
).
then
(
res
=>
{
fetchConfig
(
!
isMock
).
then
(
res
=>
{
// 从配置服务器获取动态配置
// 从配置服务器获取动态配置
...
@@ -47,33 +64,18 @@ fetchConfig(!isMock).then(res => {
...
@@ -47,33 +64,18 @@ fetchConfig(!isMock).then(res => {
Vue
.
use
(
cfg
)
Vue
.
use
(
cfg
)
window
.
$fetchConfig
=
res
window
.
$fetchConfig
=
res
if
(
res
.
vconsole
)
new
VConsole
()
if
(
res
.
vconsole
)
new
VConsole
()
let
body
=
document
.
getElementsByTagName
(
'head'
)[
0
],
WXJDK
=
document
.
createElement
(
'script'
),
WWJDK
=
document
.
createElement
(
'script'
),
ISWXWORK
=
false
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
// WWJDK.src = '//open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js'
WWJDK
.
src
=
'//res.wx.qq.com/wwopen/js/jsapi/jweixin-1.0.0.js'
ISWXWORK
=
true
}
window
.
$ISWXWORK
=
ISWXWORK
util
.
setLocalStorage
(
'is_wxwork'
,
ISWXWORK
)
Vue
.
prototype
.
ISWXWORK
=
ISWXWORK
Vue
.
prototype
.
ISMOBILE
=
util
.
isMobileDevice
()
body
.
appendChild
(
WXJDK
)
if
(
WWJDK
.
src
)
body
.
appendChild
(
WWJDK
)
/**登录过期 重新登录 */
/**登录过期 重新登录 */
window
.
reLogin
=
()
=>
{
window
.
reLogin
=
()
=>
{
console
.
log
(
'重新登录'
)
console
.
log
(
'重新登录'
)
util
.
clearSessionId
()
util
.
clearSessionId
()
store
.
dispatch
(
'navigation'
)
store
.
dispatch
(
'navigation'
)
}
}
window
.
vm
=
new
Vue
({
WXJDK
.
onload
=
function
()
{
el
:
'#app'
,
window
.
vm
=
new
Vue
({
router
,
el
:
'#app'
,
store
,
router
,
render
:
h
=>
h
(
App
)
store
,
})
render
:
h
=>
h
(
App
)
})
}
})
})
Write
Preview
Markdown
is supported
Attach a file
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 post a comment