Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jnpf-app-vue3-dj
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zuoliyuan
jnpf-app-vue3-dj
Commits
8c42825e
Commit
8c42825e
authored
Jan 17, 2025
by
zuoliyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
授权
parent
c73f2bbb
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
370 deletions
+0
-370
pages/launch/index - 副本 (2).vue
pages/launch/index - 副本 (2).vue
+0
-91
pages/launch/index - 副本 (3).vue
pages/launch/index - 副本 (3).vue
+0
-74
pages/launch/index - 副本 (4).vue
pages/launch/index - 副本 (4).vue
+0
-158
pages/launch/index-普通账号密码登录.vue
pages/launch/index-普通账号密码登录.vue
+0
-0
pages/login/index - 副本 (2).vue
pages/login/index - 副本 (2).vue
+0
-47
pages/login/index - 副本 (3).vue
pages/login/index - 副本 (3).vue
+0
-0
pages/login/index - 副本.vue
pages/login/index - 副本.vue
+0
-0
No files found.
pages/launch/index - 副本 (2).vue
deleted
100644 → 0
View file @
c73f2bbb
<
template
>
<view
class=
"content"
>
<image
class=
"logo"
src=
"/static/logo.png"
></image>
<view
class=
"text-area"
>
<text
class=
"title"
style=
"font-size: 12px;padding: 100px;"
@
click=
"copy"
>
{{
title
}}
</text>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
title
:
this
.
$route
.
query
.
code
}
},
onLoad
()
{
// localStorage.removeItem("hasLogin")
// console.log("code:"+this.$route.query.code);
debugger
if
(
!
localStorage
.
getItem
(
"
hasLogin
"
))
{
uni
.
redirectTo
({
url
:
'
/pages/login/index
'
});
}
if
(
this
.
$route
.
query
.
code
)
{
// 从静模授权进入首页
localStorage
.
setItem
(
"
auth_code
"
,
this
.
$route
.
query
.
code
)
// alert("code:" + this.$route.query.code);
// this.getuserinfo3rd()
}
},
methods
:
{
// 获取敏感信息
getuserinfo3rd
:
function
()
{
uni
.
request
({
url
:
'
http://127.0.0.1:4523/m1/2230462-1135055-default/getData?code=
'
+
this
.
$route
.
query
.
code
,
method
:
'
get
'
,
success
:
function
(
res
)
{
// alert(res.data.hasChildren, this.$route.query.code)
console
.
log
(
"
res:
"
+
res
);
}
})
},
copy
:
function
()
{
uni
.
setClipboardData
({
data
:
this
.
$route
.
query
.
code
,
success
:
()
=>
{
uni
.
showToast
({
title
:
'
复制成功
'
,
duration
:
2000
,
icon
:
'
success
'
});
}
});
}
}
}
</
script
>
<
style
>
.content
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.logo
{
height
:
200
rpx
;
width
:
200
rpx
;
margin-top
:
200
rpx
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-bottom
:
50
rpx
;
}
.text-area
{
display
:
flex
;
justify-content
:
center
;
}
.title
{
font-size
:
36
rpx
;
color
:
#8f8f94
;
}
</
style
>
\ No newline at end of file
pages/launch/index - 副本 (3).vue
deleted
100644 → 0
View file @
c73f2bbb
<
template
>
<view
class=
"content"
>
<image
class=
"logo"
src=
"/static/logo.png"
></image>
<view
class=
"text-area"
>
<text
class=
"title"
>
{{
title
}}
</text>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
title
:
this
.
$route
.
query
.
code
}
},
onLoad
()
{
if
(
localStorage
.
getItem
(
"
hasLogin
"
)
==
'
false
'
){
uni
.
redirectTo
({
url
:
'
../login/login
'
});
}
if
(
this
.
$route
.
query
.
code
){
// 从静模授权进入首页
localStorage
.
setItem
(
"
auth_code
"
,
this
.
$route
.
query
.
code
)
this
.
getuserinfo3rd
()
}
},
methods
:
{
// 获取敏感信息
getuserinfo3rd
:
function
(){
uni
.
request
({
url
:
'
http://tantan.vaiwan.com/login/getuserinfo3rd.do?code=
'
+
this
.
$route
.
query
.
code
,
method
:
'
POST
'
,
success
:
function
(
res
)
{
console
.
log
(
"
res:
"
+
res
);
}
})
}
}
}
</
script
>
<
style
>
.content
{
display
:
flex
;
flex-direction
:
column
;
align-items
:
center
;
justify-content
:
center
;
}
.logo
{
height
:
200
rpx
;
width
:
200
rpx
;
margin-top
:
200
rpx
;
margin-left
:
auto
;
margin-right
:
auto
;
margin-bottom
:
50
rpx
;
}
.text-area
{
display
:
flex
;
justify-content
:
center
;
}
.title
{
font-size
:
36
rpx
;
color
:
#8f8f94
;
}
</
style
>
\ No newline at end of file
pages/launch/index - 副本 (4).vue
deleted
100644 → 0
View file @
c73f2bbb
<
template
>
<view
class=
"launch-v"
>
<!-- #ifdef APP-PLUS -->
<view
class=
"launch-box"
>
<view
class=
"title"
>
全新模式 为你而来
</view>
<view
class=
"version"
>
VERSION3.7
</view>
<view
class=
"launch-img"
>
<image
:src=
"startup"
mode=
"widthFix"
></image>
</view>
<!--
<view
class=
"copyright"
>
Copyright © 2024 华中师范大学出品
</view>
-->
</view>
<!-- #endif -->
</view>
</
template
>
<
script
>
import
resources
from
'
@/libs/resources.js
'
import
{
useUserStore
}
from
'
@/store/modules/user
'
export
default
{
data
()
{
return
{
startup
:
resources
.
startup
.
main
}
},
onLoad
()
{
if
(
uni
.
getStorageSync
(
'
isUpdate
'
))
return
const
launchFlag
=
uni
.
getStorageSync
(
'
launchFlag
'
);
const
token
=
uni
.
getStorageSync
(
"
token
"
)
||
''
;
console
.
log
(
launchFlag
,
999
)
if
(
launchFlag
)
{
alert
(
1
)
if
(
token
)
{
uni
.
switchTab
({
url
:
'
/pages/index/index
'
})
}
else
{
uni
.
redirectTo
({
url
:
'
/pages/login/index
'
})
}
}
else
{
alert
(
2
)
// #ifdef APP-PLUS
uni
.
redirectTo
({
url
:
'
/pages/launch/policy
'
})
// #endif
// #ifndef APP-PLUS
if
(
token
)
{
alert
(
3
)
uni
.
switchTab
({
url
:
'
/pages/index/index
'
})
}
else
{
// uni.redirectTo({
// url: '/pages/login/qywxLogin'
// })
if
(
!
localStorage
.
getItem
(
"
hasLogin
"
))
{
alert
(
4
)
uni
.
redirectTo
({
url
:
'
/pages/login/qywxLogin
'
})
}
if
(
this
.
$route
.
query
.
code
)
{
alert
(
5
)
// 从静模授权进入首页
localStorage
.
setItem
(
"
auth_code
"
,
this
.
$route
.
query
.
code
)
this
.
getToken
()
}
}
// #endif
}
},
methods
:
{
// 获取敏感信息
getToken
:
function
()
{
const
userStore
=
useUserStore
()
const
data
=
{
nonPassword
:
'
nonPassword
'
,
grant_type
:
'
password
'
,
code
:
this
.
$route
.
query
.
code
}
uni
.
request
({
url
:
'
https://dj.ccnu.edu.cn/api/oauth/wechat/getToken
'
,
data
:
JSON
.
stringify
(
data
),
method
:
'
POST
'
,
success
:
function
(
res
)
{
alert
(
"
res:
"
+
res
.
data
.
token
+
'
;
'
+
this
.
$route
.
query
.
code
);
let
token
=
res
.
data
.
token
userStore
.
setToken
(
token
)
// this.rememberAccount()
userStore
.
getCurrentUser
().
then
(
res
=>
{
// this.loading = false
uni
.
switchTab
({
url
:
'
/pages/index/index
'
});
}).
catch
(()
=>
{
// this.loading = false
})
}
})
}
}
}
</
script
>
<
style
lang=
"scss"
>
.launch-v
{
.launch-box
{
padding-top
:
170rpx
;
.title
{
font-size
:
50rpx
;
line-height
:
70rpx
;
color
:
#5098FA
;
text-align
:
center
;
margin-bottom
:
10rpx
;
}
.version
{
width
:
250rpx
;
margin
:
0
auto
;
text-align
:
center
;
height
:
50rpx
;
border
:
1px
solid
#5098FA
;
border-radius
:
25rpx
;
line-height
:
48rpx
;
color
:
#5098FA
;
letter-spacing
:
2rpx
;
}
.launch-img
{
margin
:
0
auto
;
width
:
680rpx
;
image
{
width
:
100%
;
}
}
.copyright
{
position
:
fixed
;
bottom
:
120rpx
;
right
:
0
;
left
:
0
;
text-align
:
center
;
color
:
#999999
;
font-size
:
24rpx
;
}
}
}
</
style
>
\ No newline at end of file
pages/launch/index
- 副本
.vue
→
pages/launch/index
-普通账号密码登录
.vue
View file @
8c42825e
File moved
pages/login/index - 副本 (2).vue
deleted
100644 → 0
View file @
c73f2bbb
<
template
>
<view
style=
"width: 96%;margin: 0 auto;"
>
<view>
<form
@
submit=
"doLogin"
>
<button
plain=
"true"
class=
"loginBtn"
lang=
"zh_CN"
form-type=
"submit"
>
登录
</button>
</form>
</view>
</view>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
usercode
:
''
,
password
:
''
,
passwordHidden
:
true
}
},
onLoad
:
function
()
{
localStorage
.
removeItem
(
"
hasLogin
"
)
},
methods
:
{
doLogin
()
{
let
_this
=
this
localStorage
.
setItem
(
"
hasLogin
"
,
true
)
// 这里放自己的域名
let
redirect_uri
=
encodeURI
(
"
https://dj.ccnu.edu.cn/app
"
)
let
authorUrl
=
'
https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx7219d601c7041b7a&redirect_uri=
'
+
redirect_uri
+
'
&response_type=code&scope=snsapi_base&state=STATE&agentid=1000396#wechat_redirect
'
console
.
log
(
authorUrl
,
898
)
window
.
location
.
href
=
authorUrl
}
}
}
</
script
>
<
style
>
.loginBtn
{
color
:
#337bd4
!important
;
border
:
1
rpx
solid
#337bd4
!important
;
font-size
:
30
rpx
;
border-radius
:
50
rpx
;
}
</
style
>
\ No newline at end of file
pages/login/index - 副本 (3).vue
deleted
100644 → 0
View file @
c73f2bbb
This diff is collapsed.
Click to expand it.
pages/login/index - 副本.vue
deleted
100644 → 0
View file @
c73f2bbb
This diff is collapsed.
Click to expand it.
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