Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
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 aff342bb
authored
Jan 13, 2022
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
441791e5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
30 deletions
linkwe-taskMobile/src/index.html
linkwe-taskMobile/src/js/common.js
linkwe-taskMobile/src/js/request.js
linkwe-taskMobile/src/js/utils.js
linkwe-taskMobile/src/index.html
View file @
aff342b
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"
>
<meta
name=
"viewport"
content=
"width=device-width, minimum-scale=1.0, maximum-scale=1.0, initial-scale=1.0, user-scalable=no"
>
<title>
linke-wechat
</title>
</head>
<body>
<div
class=
"container"
>
<img
src=
''
class=
'posterImg'
/>
<img
src=
''
class=
'posterImg'
/>
<div
class=
"footerLink"
>
<div
class=
"sharePic"
>
分享图片
</div>
<div
class=
"sharePic"
>
分享图片
</div>
<div
class=
"myTaskDetail"
>
我的邀请任务进度
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
linkwe-taskMobile/src/js/common.js
View file @
aff342b
//
import vconsole from 'vconsole'
import
vconsole
from
'vconsole'
$
(
function
()
{
var
dpr
,
rem
,
scale
var
docEl
=
document
.
documentElement
...
...
@@ -31,6 +31,5 @@ $(function () {
window
.
dpr
=
dpr
window
.
rem
=
rem
// var myConsole = new vconsole()
console
.
log
(
'hello'
)
new
vconsole
()
})
linkwe-taskMobile/src/js/request.js
View file @
aff342b
...
...
@@ -23,7 +23,7 @@ const request = (url, params, method = 'get') => {
},
error
(
err
)
{
// console.log(err.status)
alert
(
url
+
err
.
status
)
alert
(
url
+
',错误码:'
+
err
.
status
)
reject
(
err
)
}
})
...
...
linkwe-taskMobile/src/js/utils.js
View file @
aff342b
import
config
from
'./contant'
export
function
getUrlParam
(
name
)
{
let
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
let
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
]);
}
return
null
;
export
function
getUrlParam
(
name
)
{
let
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
)
let
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
])
}
return
null
}
export
function
getWxCode
(){
let
appid
=
"wxa57479bcd3f15461"
;
let
code
=
getUrlParam
(
"code"
);
//是否存在code
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
;
// let local = 'http://h5.x*****o.com/'
if
(
code
==
null
||
code
===
""
)
{
//不存在就打开上面的地址进行授权
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
local
)}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
export
function
getWxCode
()
{
let
appid
=
'wx8bfe6bc2ca5c45ae'
// 公众号appid
let
code
=
getUrlParam
(
'code'
)
//是否存在code
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)
?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
// let local = 'http://h5.x*****o.com/'
if
(
code
==
null
||
code
===
''
)
{
//不存在就打开上面的地址进行授权
window
.
location
.
href
=
`https://open.weixin.qq.com/connect/oauth2/authorize?appid=
${
appid
}
&redirect_uri=
${
encodeURIComponent
(
local
)}
&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect`
return
false
// window.location.href =
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
}
else
{
config
.
code
=
code
}
}
\ No newline at end of file
return
false
// window.location.href =
// `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${encodeURIComponent(local)}&response_type=code&scope=snsapi_userinfo&state=1#wechat_redirect`;
}
else
{
config
.
code
=
code
}
}
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