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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
src/main.js
src/main.js
View file @
5923c07
...
@@ -40,40 +40,42 @@ Vue.prototype.to = function (name, params) {
...
@@ -40,40 +40,42 @@ Vue.prototype.to = function (name, params) {
import
VConsole
from
'vconsole'
import
VConsole
from
'vconsole'
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
ua
=
navigator
.
userAgent
.
toLowerCase
()
const
isMock
=
[
'prod'
,
'production'
].
includes
(
process
.
env
.
NODE_ENV
)
let
body
=
document
.
getElementsByTagName
(
'head'
)[
0
],
fetchConfig
(
!
isMock
).
then
(
res
=>
{
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue
.
use
(
cfg
)
window
.
$fetchConfig
=
res
if
(
res
.
vconsole
)
new
VConsole
()
let
body
=
document
.
getElementsByTagName
(
'head'
)[
0
],
WXJDK
=
document
.
createElement
(
'script'
),
WXJDK
=
document
.
createElement
(
'script'
),
WWJDK
=
document
.
createElement
(
'script'
),
WWJDK
=
document
.
createElement
(
'script'
),
ISWXWORK
=
false
ISWXWORK
=
false
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.6.0.js'
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
if
(
Boolean
(
ua
.
match
(
/MicroMessenger/i
))
&&
Boolean
(
ua
.
match
(
/wxwork/i
)))
{
//是否企微
WXJDK
.
src
=
'//res.wx.qq.com/open/js/jweixin-1.2.0.js'
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 = '//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'
WWJDK
.
src
=
'//res.wx.qq.com/wwopen/js/jsapi/jweixin-1.0.0.js'
ISWXWORK
=
true
ISWXWORK
=
true
}
}
window
.
$ISWXWORK
=
ISWXWORK
window
.
$ISWXWORK
=
ISWXWORK
util
.
setLocalStorage
(
'is_wxwork'
,
ISWXWORK
)
util
.
setLocalStorage
(
'is_wxwork'
,
ISWXWORK
)
Vue
.
prototype
.
ISWXWORK
=
ISWXWORK
Vue
.
prototype
.
ISWXWORK
=
ISWXWORK
Vue
.
prototype
.
ISMOBILE
=
util
.
isMobileDevice
()
Vue
.
prototype
.
ISMOBILE
=
util
.
isMobileDevice
()
body
.
appendChild
(
WXJDK
)
body
.
appendChild
(
WXJDK
)
if
(
WWJDK
.
src
)
body
.
appendChild
(
WWJDK
)
if
(
WWJDK
.
src
)
body
.
appendChild
(
WWJDK
)
const
isMock
=
[
'prod'
,
'production'
].
includes
(
process
.
env
.
NODE_ENV
)
fetchConfig
(
!
isMock
).
then
(
res
=>
{
// 从配置服务器获取动态配置
// 设置 js中可以访问 $cdn
Vue
.
use
(
cfg
)
window
.
$fetchConfig
=
res
if
(
res
.
vconsole
)
new
VConsole
()
/**登录过期 重新登录 */
/**登录过期 重新登录 */
window
.
reLogin
=
()
=>
{
window
.
reLogin
=
()
=>
{
console
.
log
(
'重新登录'
)
console
.
log
(
'重新登录'
)
util
.
clearSessionId
()
util
.
clearSessionId
()
store
.
dispatch
(
'navigation'
)
store
.
dispatch
(
'navigation'
)
}
}
WXJDK
.
onload
=
function
()
{
window
.
vm
=
new
Vue
({
window
.
vm
=
new
Vue
({
el
:
'#app'
,
el
:
'#app'
,
router
,
router
,
store
,
store
,
render
:
h
=>
h
(
App
)
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