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
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
20 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>
<!DOCTYPE html>
<html
lang=
"en"
>
<html
lang=
"en"
>
<head>
<head>
<meta
charset=
"UTF-8"
>
<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>
<title>
linke-wechat
</title>
</head>
</head>
<body>
<body>
<div
class=
"container"
>
<div
class=
"container"
>
<img
src=
''
class=
'posterImg'
/>
<img
src=
''
class=
'posterImg'
/>
<div
class=
"footerLink"
>
<div
class=
"footerLink"
>
<div
class=
"sharePic"
>
分享图片
</div>
<div
class=
"sharePic"
>
分享图片
</div>
<div
class=
"myTaskDetail"
>
我的邀请任务进度
</div>
<div
class=
"myTaskDetail"
>
我的邀请任务进度
</div>
</div>
</div>
</div>
</div>
</body>
</body>
</html>
</html>
\ No newline at end of file
\ No newline at end of file
linkwe-taskMobile/src/js/common.js
View file @
aff342b
//
import vconsole from 'vconsole'
import
vconsole
from
'vconsole'
$
(
function
()
{
$
(
function
()
{
var
dpr
,
rem
,
scale
var
dpr
,
rem
,
scale
var
docEl
=
document
.
documentElement
var
docEl
=
document
.
documentElement
...
@@ -31,6 +31,5 @@ $(function () {
...
@@ -31,6 +31,5 @@ $(function () {
window
.
dpr
=
dpr
window
.
dpr
=
dpr
window
.
rem
=
rem
window
.
rem
=
rem
// var myConsole = new vconsole()
new
vconsole
()
console
.
log
(
'hello'
)
})
})
linkwe-taskMobile/src/js/request.js
View file @
aff342b
...
@@ -23,7 +23,7 @@ const request = (url, params, method = 'get') => {
...
@@ -23,7 +23,7 @@ const request = (url, params, method = 'get') => {
},
},
error
(
err
)
{
error
(
err
)
{
// console.log(err.status)
// console.log(err.status)
alert
(
url
+
err
.
status
)
alert
(
url
+
',错误码:'
+
err
.
status
)
reject
(
err
)
reject
(
err
)
}
}
})
})
...
...
linkwe-taskMobile/src/js/utils.js
View file @
aff342b
import
config
from
'./contant'
import
config
from
'./contant'
export
function
getUrlParam
(
name
)
{
export
function
getUrlParam
(
name
)
{
let
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
let
reg
=
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
)
let
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
let
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
)
if
(
r
!=
null
)
{
if
(
r
!=
null
)
{
return
unescape
(
r
[
2
]);
return
unescape
(
r
[
2
])
}
}
return
null
;
return
null
}
}
export
function
getWxCode
(){
export
function
getWxCode
()
{
let
appid
=
"wxa57479bcd3f15461"
;
let
appid
=
'wx8bfe6bc2ca5c45ae'
// 公众号appid
let
code
=
getUrlParam
(
"code"
);
//是否存在code
let
code
=
getUrlParam
(
'code'
)
//是否存在code
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
;
let
local
=
window
.
location
.
origin
.
includes
(
'localhost'
)
?
'http://h5.linkwechat.cn/test.html'
:
window
.
location
.
href
// let local = 'http://h5.x*****o.com/'
// let local = 'http://h5.x*****o.com/'
if
(
code
==
null
||
code
===
""
)
{
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`
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
return
false
// window.location.href =
// 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`;
// `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
{
}
else
{
config
.
code
=
code
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