Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CFFP-HB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chao Sun
CFFP-HB
Commits
e6d1d1d5
Commit
e6d1d1d5
authored
Nov 02, 2022
by
sunchao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆注册
parent
d3eab360
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
625 additions
and
79 deletions
+625
-79
App.vue
+3
-0
api/api.ts
+13
-2
common/common.ts
+23
-0
components/courselist/courselist.vue
+18
-0
components/login/login.vue
+161
-28
environments/environment.ts
+6
-5
main.js
+1
-2
manifest.json
+21
-1
pages.json
+53
-2
pages/index/index.vue
+14
-1
pages/my/my.vue
+9
-0
unpackage/dist/dev/app-plus/app-service.js
+251
-36
unpackage/dist/dev/app-plus/components/login/login.css
+3
-0
unpackage/dist/dev/app-plus/manifest.json
+1
-0
util/interceptor.ts
+2
-2
util/router.js
+46
-0
No files found.
App.vue
View file @
e6d1d1d5
<
script
>
<
script
>
import
initApp
from
"@/util/router.js"
;
import
{
interceptor
}
from
'@/util/interceptor.ts'
;
export
default
{
export
default
{
onLaunch
:
function
()
{
onLaunch
:
function
()
{
console
.
log
(
'App Launch'
)
console
.
log
(
'App Launch'
)
initApp
()
},
},
onShow
:
function
()
{
onShow
:
function
()
{
console
.
log
(
'App Show'
)
console
.
log
(
'App Show'
)
...
...
api/api.ts
View file @
e6d1d1d5
import
request
from
"../util/request"
;
import
request
from
"../util/request"
;
import
{
baseURL
,
apiURL
,
s
fpURL
}
from
"../environments/environment"
;
import
{
baseURL
,
apiURL
,
cf
fpURL
}
from
"../environments/environment"
;
export
default
{
export
default
{
//查看token是否已经失效
//查看token是否已经失效
...
@@ -17,6 +17,17 @@ export default {
...
@@ -17,6 +17,17 @@ export default {
}
}
return
request
(
`
${
baseURL
}
/api/authorize/obtainToken`
,
"POST"
,
params
)
return
request
(
`
${
baseURL
}
/api/authorize/obtainToken`
,
"POST"
,
params
)
},
},
//获取验证码
verificationCode
(
params
){
return
request
(
`
${
baseURL
}
/api/verificationCode`
,
"POST"
,
params
)
},
//登录接口
loginVerification
(
params
){
return
request
(
`
${
cffpURL
}
/user/loginVerification`
,
"POST"
,
params
)
},
//注册接口
register
(
params
){
return
request
(
`
${
cffpURL
}
/user/register`
,
"POST"
,
params
)
}
}
}
common/common.ts
0 → 100644
View file @
e6d1d1d5
export
default
{
mobileNoValid
(
no
)
{
const
MOBILE_REGEXP
=
/^
(
1
)\d{10}
$/
;
return
MOBILE_REGEXP
.
test
(
no
);
},
// 封装报错弹窗
errorDialog
(
type
,
content
){
// type 1 必填项校验 2 规则校验
uni
.
showModal
({
title
:
type
===
1
?
'必填项校验'
:
'规则校验'
,
content
:
content
,
showCancel
:
false
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
console
.
log
(
'用户点击确定'
);
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
});
},
}
\ No newline at end of file
components/courselist/courselist.vue
0 → 100644
View file @
e6d1d1d5
<
template
>
<view>
课程列表
</view>
</
template
>
<
script
>
export
default
{
data
(){
return
;
},
name
:
'courselist'
,
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
components/login/login.vue
View file @
e6d1d1d5
...
@@ -10,14 +10,19 @@
...
@@ -10,14 +10,19 @@
</view>
</view>
<form>
<form>
<view
class=
"inputItem"
v-if=
"loginType==='register'"
>
<view
class=
"inputItem"
v-if=
"loginType==='register'"
>
<input
class=
"uni-input"
name=
"invitationCode"
placeholder=
"输入邀请码(非必填)"
/>
<input
class=
"uni-input"
name=
"invitationCode"
placeholder=
"输入邀请码(非必填)"
v-model=
"invitation_code"
/>
</view>
</view>
<view
class=
"inputItem"
>
<view
class=
"inputItem"
v-if=
"loginType!=='agentlogin'"
>
<input
class=
"uni-input"
name=
"mobileNo"
placeholder=
"输入手机号"
/>
<input
class=
"uni-input"
name=
"mobileNo"
placeholder=
"输入手机号"
v-model=
"form.mobile"
maxlength=
"11"
/>
</view>
</view>
<view
class=
"inputItem"
v-if=
"loginType === 'codelogin' || loginType==='register'"
>
<view
class=
"inputItem"
v-if=
"loginType==='agentlogin'"
>
<input
class=
"uni-input"
name=
"code"
placeholder=
"输入验证码"
/>
<input
class=
"uni-input"
name=
"mobileNo"
placeholder=
"输入账号"
v-model=
"account"
maxlength=
"11"
<text
@
click=
"sendMessage()"
>
{{
sedCode
}}
</text>
/>
</view>
<view
class=
"inputItem"
v-if=
"loginType === 'codelogin' || loginType==='register' || loginType === 'resetpw'"
>
<input
class=
"uni-input"
name=
"code"
placeholder=
"输入验证码"
v-model=
"form.code"
type=
"number"
/>
<text
@
click=
"sendMessage()"
:class=
"
{'grey':disabledSendBtn}">
{{
sendCodeHtml
}}
</text>
</view>
</view>
<view
class=
"inputItem"
v-if=
"loginType === 'pwlogin' || loginType==='register'"
>
<view
class=
"inputItem"
v-if=
"loginType === 'pwlogin' || loginType==='register'"
>
<input
class=
"uni-input"
type=
"text"
name=
"password"
placeholder=
"输入密码"
v-if=
"!passwordFlag"
/>
<input
class=
"uni-input"
type=
"text"
name=
"password"
placeholder=
"输入密码"
v-if=
"!passwordFlag"
/>
...
@@ -25,26 +30,40 @@
...
@@ -25,26 +30,40 @@
<text
v-if=
"passwordFlag"
@
click=
"passwordFlag=false"
>
显示密码
</text>
<text
v-if=
"passwordFlag"
@
click=
"passwordFlag=false"
>
显示密码
</text>
<text
v-if=
"!passwordFlag"
@
click=
"passwordFlag=true"
>
不显示密码
</text>
<text
v-if=
"!passwordFlag"
@
click=
"passwordFlag=true"
>
不显示密码
</text>
</view>
</view>
<!--重置密码-->
<view
v-if=
"loginType === 'resetpw'"
>
<view
class=
"inputItem"
>
<input
class=
"uni-input"
type=
"text"
password
name=
"password"
placeholder=
"密码(6-20位字母数字组合)"
/>
</view>
<view
class=
"inputItem"
>
<input
class=
"uni-input"
type=
"text"
password
name=
"password"
placeholder=
"再次确认密码"
/>
</view>
</view>
</form>
</form>
<view
class=
"agree"
>
<view
class=
"agree"
v-if=
"loginType!='resetpw'"
>
<icon
:type=
"radioUnselect"
size=
"26"
/><text>
已阅读并同意
</text><a
href=
"#"
>
银盾保险经纪服务协议
</a><text>
和
</text><a
href=
""
>
隐私政策
</a>
<icon
:type=
"radioUnselect"
size=
"26"
/><text>
已阅读并同意
</text><a
href=
"#"
>
银盾保险经纪服务协议
</a><text>
和
</text><a
href=
""
>
隐私政策
</a>
</view>
</view>
<view
class=
"login_btn"
>
<view
class=
"login_btn"
@
click=
"loginInCheck()()"
v-if=
"loginType!='resetpw'"
>
{{
loginType
==
'register'
?
'注册'
:
'登录'
}}
{{
loginType
==
'register'
?
'注册'
:
'登录'
}}
{{
loginType
}}
</view>
</view>
<view
class=
"login_type"
>
<view
class=
"login_btn"
v-if=
"loginType=='resetpw'"
>
<text
@
click=
"getLogin()"
>
{{
(
loginType
==
'pwlogin'
||
loginType
==
'register'
)?
'验证码登录'
:
'密码登录'
}}
</text>
保存
</view>
<view
class=
"login_type"
v-if=
"loginType!='resetpw'"
>
<text
@
click=
"getLoginType()"
>
{{
(
loginType
==
'pwlogin'
||
loginType
==
'register'
)?
'验证码登录'
:
'密码登录'
}}
</text>
<text
@
click=
"register()"
>
{{
loginType
==
'codelogin'
?
'立即注册'
:
'忘记密码'
}}
</text>
<text
@
click=
"register()"
>
{{
loginType
==
'codelogin'
?
'立即注册'
:
'忘记密码'
}}
</text>
</view>
</view>
<view>
<view
v-if=
"loginType!='resetpw'"
>
<view
class=
"other_login"
>
<view
class=
"other_login"
>
<text
class=
"text_line"
></text>
<text
class=
"text_line"
></text>
<text
style=
"margin: 0 40rpx;position: relative;top: 10rpx;"
>
其他登录
</text>
<text
style=
"margin: 0 40rpx;position: relative;top: 10rpx;"
>
其他登录
</text>
<text
class=
"text_line"
></text>
<text
class=
"text_line"
></text>
</view>
</view>
<view
class=
"login_type"
>
<view
class=
"login_type"
>
<text>
游客
</text>
<text
@
click=
"loginType='visitor';loginIn(1)"
>
游客
</text>
<text>
代理商
</text>
<text
@
click=
"loginType = 'agentlogin';loginTypeName = '管理账号登录';"
>
代理商
</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
@@ -53,6 +72,9 @@
...
@@ -53,6 +72,9 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
api
from
'../../api/api'
;
import
common
from
'../../common/common'
;
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
...
@@ -60,40 +82,148 @@
...
@@ -60,40 +82,148 @@
loginType
:
'codelogin'
,
loginType
:
'codelogin'
,
passwordFlag
:
false
,
passwordFlag
:
false
,
loginTypeName
:
'验证码登录'
,
loginTypeName
:
'验证码登录'
,
countdown
:
60
,
remainTimes
:
60
,
sedCode
:
'获取验证码'
sendCodeHtml
:
'获取验证码'
,
//用户输入信息
form
:{
mobile
:
null
,
code
:
null
,
password
:
null
,
},
disabledSendBtn
:
false
,
invitation_code
:
null
,
account
:
null
}
}
},
},
methods
:
{
methods
:
{
formReset
:
function
(
e
)
{
formReset
:
function
(
e
)
{
console
.
log
(
'清空数据'
)
console
.
log
(
'清空数据'
)
},
},
getLogin
(){
getLogin
Type
(){
this
.
loginType
===
'codelogin'
?
this
.
loginType
=
'pwlogin'
:
this
.
loginType
=
'codelogin'
;
this
.
loginType
===
'codelogin'
?
this
.
loginType
=
'pwlogin'
:
this
.
loginType
=
'codelogin'
;
this
.
loginTypeName
=
this
.
loginType
==
'codelogin'
?
'验证码登录'
:
'密码登录'
;
this
.
loginTypeName
=
this
.
loginType
==
'codelogin'
?
'验证码登录'
:
'密码登录'
;
this
.
loginType
===
'codelogin'
?
this
.
form
.
password
=
null
:
this
.
form
.
code
=
null
;
},
},
register
(){
register
(){
this
.
loginType
=
'register'
;
this
.
loginType
===
'register'
?
this
.
loginType
=
'resetpw'
:
this
.
loginType
=
'register'
;
this
.
loginTypeName
=
'注册
'
;
this
.
loginTypeName
=
this
.
loginType
==
'register'
?
'注册'
:
'重置密码
'
;
},
},
sendMessage
(){
sendMessage
(){
const
params
=
{
mobileNo
:
this
.
form
.
mobile
,
type
:
"1"
}
if
(
common
.
mobileNoValid
(
this
.
form
.
mobile
)
&&
!
this
.
disabledSendBtn
){
api
.
verificationCode
(
params
).
then
((
res
)
=>
{
console
.
log
(
res
)
if
(
res
[
'success'
]){
this
.
delayTime
()
this
.
delayTime
()
}
})
}
else
{
common
.
errorDialog
(
2
,
'手机号校验错误'
)
}
},
},
delayTime
()
{
delayTime
()
{
if
(
this
.
countdown
==
0
)
{
this
.
disabledSendBtn
=
true
;
this
.
isValid
=
false
;
this
.
timer
=
setInterval
(()
=>
{
this
.
sedCode
=
"重新发送"
;
this
.
remainTimes
--
;
this
.
countdown
=
60
;
this
.
sendCodeHtml
=
`
${
this
.
remainTimes
}
(S)`
;
}
else
{
if
(
this
.
remainTimes
<=
0
)
{
this
.
isValid
=
true
;
this
.
sendCodeHtml
=
'获取验证码'
;
this
.
sedCode
=
this
.
countdown
+
"s"
;
this
.
remainTimes
=
60
;
this
.
countdown
--
;
this
.
disabledSendBtn
=
false
;
setTimeout
(()
=>
{
clearInterval
(
this
.
timer
);
this
.
delayTime
();
}
},
1000
);
},
1000
);
},
loginIn
(
loginType
){
console
.
log
(
loginType
)
const
params
=
{
loginType
:
loginType
,
...
this
.
form
}
console
.
log
(
params
)
api
.
loginVerification
(
params
).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
uni
.
setStorageSync
(
'isLogin'
,
1
)
uni
.
navigateTo
({
url
:
'/pages/index/index'
})
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
}
})
},
registerIn
(){
const
params
=
{
invitation_code
:
this
.
invitation_code
,
...
this
.
form
}
console
.
log
(
params
)
api
.
register
(
params
).
then
((
res
)
=>
{
if
(
res
[
'success'
]){
uni
.
setStorageSync
(
'isLogin'
,
1
)
uni
.
navigateTo
({
url
:
'/pages/index/index'
})
}
else
{
uni
.
showToast
({
title
:
res
[
'message'
],
duration
:
2000
,
icon
:
'none'
})
}
})
},
loginInCheck
(){
//只有代理商登录不需要填写手机号
if
(
this
.
loginType
!==
'agentlogin'
){
if
(
!
this
.
form
.
mobile
){
common
.
errorDialog
(
1
,
'请输入手机号'
);
return
false
;
}
if
(
!
common
.
mobileNoValid
(
this
.
form
.
mobile
)){
common
.
errorDialog
(
2
,
'手机号格式填写错误'
);
return
false
;
}
if
(
this
.
loginType
===
'codelogin'
){
if
(
!
this
.
form
.
code
){
common
.
errorDialog
(
1
,
'请输入验证码'
);
return
false
;
}
this
.
loginIn
(
3
)
}
if
(
this
.
loginType
===
'password'
){
if
(
!
this
.
form
.
code
){
common
.
errorDialog
(
1
,
'请输入密码'
);
return
false
;
}
this
.
loginIn
(
2
)
}
}
if
(
this
.
loginType
===
'register'
){
}
}
if
(
this
.
loginType
===
'agentlogin'
){
if
(
!
this
.
account
){
if
(
!
this
.
form
.
code
){
common
.
errorDialog
(
1
,
'请输入密码'
);
return
false
;
}
}
}
}
this
.
loginIn
(
4
)
}
}
},
mounted
()
{
}
}
}
</
script
>
</
script
>
...
@@ -151,6 +281,9 @@
...
@@ -151,6 +281,9 @@
top
:
20
rpx
;
top
:
20
rpx
;
color
:
#20279B
;
color
:
#20279B
;
}
}
.grey
{
color
:
#CECECE
;
}
}
}
}
}
.agree
{
.agree
{
...
...
environments/environment.ts
View file @
e6d1d1d5
const
dev
=
{
const
dev
=
{
base_url
:
'https://mdev.zuihuibi.cn'
,
base_url
:
'https://mdev.zuihuibi.cn'
,
api_url
:
'https://mdev.zuihuibi.cn/api'
,
api_url
:
'https://mdev.zuihuibi.cn/api'
,
sfp_url
:
'https://mdev.zuihuibi.cn/api/s
fp'
cffp_url
:
'https://mdev.zuihuibi.cn/api/cf
fp'
}
}
const
stage
=
{
const
stage
=
{
base_url
:
'https://mstage.zuihuibi.cn'
,
base_url
:
'https://mstage.zuihuibi.cn'
,
api_url
:
'https://mstage.zuihuibi.cn/api'
,
api_url
:
'https://mstage.zuihuibi.cn/api'
,
sfp_url
:
'https://mstage.zuihuibi.cn/api/s
fp'
cffp_url
:
'https://mstage.zuihuibi.cn/api/cf
fp'
}
}
const
prod
=
{
const
prod
=
{
base_url
:
'https://m.zuihuibi.cn'
,
base_url
:
'https://m.zuihuibi.cn'
,
api_url
:
'https://m.zuihuibi.cn/api'
,
api_url
:
'https://m.zuihuibi.cn/api'
,
sfp_url
:
'https://m.zuihuibi.cn/api/s
fp'
cffp_url
:
'https://m.zuihuibi.cn/api/cf
fp'
}
}
const
config
=
{
const
config
=
{
...
@@ -30,10 +30,10 @@ let env = 'dev';
...
@@ -30,10 +30,10 @@ let env = 'dev';
let
baseURL
=
config
[
env
].
base_url
;
let
baseURL
=
config
[
env
].
base_url
;
let
apiURL
=
config
[
env
].
api_url
;
let
apiURL
=
config
[
env
].
api_url
;
let
sfpURL
=
config
[
env
].
s
fp_url
;
let
cffpURL
=
config
[
env
].
cf
fp_url
;
export
{
export
{
baseURL
,
baseURL
,
apiURL
,
apiURL
,
s
fpURL
cf
fpURL
}
}
\ No newline at end of file
main.js
View file @
e6d1d1d5
import
App
from
'./App'
import
App
from
'./App'
;
// #ifndef VUE3
// #ifndef VUE3
import
Vue
from
'vue'
import
Vue
from
'vue'
Vue
.
config
.
productionTip
=
false
App
.
mpType
=
'app'
App
.
mpType
=
'app'
const
app
=
new
Vue
({
const
app
=
new
Vue
({
...
App
...
App
...
...
manifest.json
View file @
e6d1d1d5
...
@@ -76,5 +76,25 @@
...
@@ -76,5 +76,25 @@
"uniStatistics"
:
{
"uniStatistics"
:
{
"enable"
:
false
"enable"
:
false
},
},
"vueVersion"
:
"3"
"vueVersion"
:
"3"
,
"h5"
:
{
"router"
:
{
"base"
:
"/cffp/"
,
"mode"
:
"history"
},
"devServer"
:
{
"proxy"
:
{
"/api"
:
{
"port"
:
3000
,
//
端口号
"target"
:
"https://mdev.zuihuibi.cn"
,
//请求的目标域名
"changeOrigin"
:
true
,
//是否跨域
"secure"
:
false
,
//设置支持https协议的代理
"logLevel"
:
"debug"
,
"pathRewrite"
:
{
"^/api"
:
""
}
}
}
}
}
}
}
pages.json
View file @
e6d1d1d5
{
{
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
"pages"
:
[
//pages数组中第一项表示应用启动页,参考:https
:
//uniapp.dcloud.io/collocation/pages
{
{
"path"
:
"
components/login/login
"
,
"path"
:
"
pages/index/index
"
,
"style"
:
{
"style"
:
{
"topWindow"
:
false
,
"topWindow"
:
false
,
"navigationBarTitleText"
:
"CFFP"
"navigationBarTitleText"
:
"CFFP"
}
}
},
{
"path"
:
"components/login/login"
,
"style"
:
{
"topWindow"
:
false
,
"navigationBarTitleText"
:
"CFFP"
}
}
},
//
{
//
"path"
:
"pages/index/index"
,
//
"style"
:
{
//
"topWindow"
:
false
,
//
"navigationBarTitleText"
:
"CFFP"
//
}
//
},
],
],
//
"tabBar"
:
{
//
"color"
:
"#7A7E83"
,
//
tab
上的文字默认颜色
//
"selectedColor"
:
"#3cc51f"
,
//
tab
上的文字选中时的颜色
//
"borderStyle"
:
"black"
,
//
tabbar
上边框的颜色,可选值
black/white
//
"backgroundColor"
:
"#ffffff"
,
//
tab
的背景色
//
"list"
:
[{
//
最少
2
个、最多
5
个
tab
//
"pagePath"
:
"pages/index/index"
,
//
页面路径,必须在
pages
中先定义
//
"iconPath"
:
"static/tabbar/home.png"
,
//
图片路径,icon
大小限制为
40
kb,建议尺寸为
81
px
*
81
px
//
"selectedIconPath"
:
"static/tabbar/home-active.png"
,
//
选中时的图片路径
//
"text"
:
"首页"
//
tab
上按钮文字
//
},
{
//
最少
2
个、最多
5
个
tab
//
"pagePath"
:
"pages/index/index"
,
//
页面路径,必须在
pages
中先定义
//
"iconPath"
:
"static/tabbar/home.png"
,
//
图片路径,icon
大小限制为
40
kb,建议尺寸为
81
px
*
81
px
//
"selectedIconPath"
:
"static/tabbar/home-active.png"
,
//
选中时的图片路径
//
"text"
:
"SFP智能财策"
//
tab
上按钮文字
//
},{
//
最少
2
个、最多
5
个
tab
//
"pagePath"
:
"pages/index/index"
,
//
页面路径,必须在
pages
中先定义
//
"iconPath"
:
"static/tabbar/home.png"
,
//
图片路径,icon
大小限制为
40
kb,建议尺寸为
81
px
*
81
px
//
"selectedIconPath"
:
"static/tabbar/home-active.png"
,
//
选中时的图片路径
//
"text"
:
"CFFP认证"
//
tab
上按钮文字
//
},{
//
"pagePath"
:
"pages/my/my"
,
//
"iconPath"
:
"static/tabbar/my.png"
,
//
"selectedIconPath"
:
"static/tabbar/my-active.png"
,
//
"text"
:
"我的"
//
}]
//
},
"globalStyle"
:
{
"globalStyle"
:
{
"navigationBarTextStyle"
:
"black"
,
"navigationBarTextStyle"
:
"black"
,
"navigationBarTitleText"
:
"uni-app"
,
"navigationBarTitleText"
:
"uni-app"
,
...
@@ -15,5 +56,15 @@
...
@@ -15,5 +56,15 @@
"backgroundColor"
:
"#F8F8F8"
,
"backgroundColor"
:
"#F8F8F8"
,
"navigationStyle"
:
"custom"
"navigationStyle"
:
"custom"
},
},
"uniIdRouter"
:
{}
"uniIdRouter"
:
{},
"condition"
:
{
//模式配置,仅开发期间生效
"current"
:
0
,
//当前激活的模式(list
的索引项)
"list"
:
[
{
"name"
:
""
,
//模式名称
"path"
:
""
,
//启动页面,必选
"query"
:
""
//启动参数,在页面的onLoad函数里面得到
}
]
}
}
}
pages/index/index.vue
View file @
e6d1d1d5
...
@@ -4,21 +4,34 @@
...
@@ -4,21 +4,34 @@
<view
class=
"text-area"
>
<view
class=
"text-area"
>
<text
class=
"title"
>
{{
title
}}
</text>
<text
class=
"title"
>
{{
title
}}
</text>
</view>
</view>
<courselist></courselist>
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
courselist
from
'../../components/courselist/courselist.vue'
export
default
{
export
default
{
data
()
{
data
()
{
return
{
return
{
title
:
'
Hello
'
title
:
'
首页
'
}
}
},
},
comments
:{
courselist
},
onLoad
()
{
onLoad
()
{
},
},
methods
:
{
methods
:
{
},
onShow
()
{
if
(
!
uni
.
getStorageSync
(
'isLogin'
)){
uni
.
navigateTo
({
url
:
'/components/login/login'
})
}
}
}
}
}
</
script
>
</
script
>
...
...
pages/my/my.vue
0 → 100644
View file @
e6d1d1d5
<
template
>
</
template
>
<
script
>
</
script
>
<
style
>
</
style
>
\ No newline at end of file
unpackage/dist/dev/app-plus/app-service.js
View file @
e6d1d1d5
var
__defProp
=
Object
.
defineProperty
;
var
__getOwnPropSymbols
=
Object
.
getOwnPropertySymbols
;
var
__hasOwnProp
=
Object
.
prototype
.
hasOwnProperty
;
var
__propIsEnum
=
Object
.
prototype
.
propertyIsEnumerable
;
var
__defNormalProp
=
(
obj
,
key
,
value
)
=>
key
in
obj
?
__defProp
(
obj
,
key
,
{
enumerable
:
true
,
configurable
:
true
,
writable
:
true
,
value
})
:
obj
[
key
]
=
value
;
var
__spreadValues
=
(
a
,
b
)
=>
{
for
(
var
prop
in
b
||
(
b
=
{}))
if
(
__hasOwnProp
.
call
(
b
,
prop
))
__defNormalProp
(
a
,
prop
,
b
[
prop
]);
if
(
__getOwnPropSymbols
)
for
(
var
prop
of
__getOwnPropSymbols
(
b
))
{
if
(
__propIsEnum
.
call
(
b
,
prop
))
__defNormalProp
(
a
,
prop
,
b
[
prop
]);
}
return
a
;
};
if
(
typeof
Promise
!==
"undefined"
&&
!
Promise
.
prototype
.
finally
)
{
if
(
typeof
Promise
!==
"undefined"
&&
!
Promise
.
prototype
.
finally
)
{
Promise
.
prototype
.
finally
=
function
(
callback
)
{
Promise
.
prototype
.
finally
=
function
(
callback
)
{
const
promise
=
this
.
constructor
;
const
promise
=
this
.
constructor
;
...
@@ -35,6 +51,136 @@ if (uni.restoreGlobal) {
...
@@ -35,6 +51,136 @@ if (uni.restoreGlobal) {
console
[
type
].
apply
(
console
,
[...
args
,
filename
]);
console
[
type
].
apply
(
console
,
[...
args
,
filename
]);
}
}
}
}
const
whiteApiList
=
[
`/api/authorize/obtainToken`
,
`/api/authorize/checkToken`
];
const
interceptor
=
()
=>
{
uni
.
addInterceptor
(
"request"
,
{
invoke
(
args
)
{
formatAppLog
(
"log"
,
"at util/interceptor.ts:13"
,
"
\
u8BF7
\
u6C42
\
u62E6
\
u622A
\
u5668"
,
args
);
uni
.
showLoading
({
title
:
"
\
u52A0
\
u8F7D
\
u4E2D..."
});
if
(
!
uni
.
getStorageSync
(
"uni-token"
)
&&
!
whiteApiList
.
includes
(
args
.
url
))
{
formatAppLog
(
"log"
,
"at util/interceptor.ts:20"
,
"-----------"
);
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
url
:
"/api/authorize/obtainToken"
,
method
:
"POST"
,
data
:
{
ticket
:
"uni-app"
},
success
:
(
res
)
=>
{
if
(
res
.
statusCode
===
200
)
{
uni
.
setStorageSync
(
"uni-token"
,
res
.
data
[
"data"
][
"token"
]);
window
.
location
.
href
=
window
.
location
.
href
+
"?t_reload="
+
new
Date
().
getTime
();
}
formatAppLog
(
"log"
,
"at util/interceptor.ts:31"
,
res
);
},
fail
(
err
)
{
reject
(
err
);
}
});
uni
.
hideLoading
();
return
false
;
});
}
args
.
header
=
{
"content-type"
:
args
.
method
===
"POST"
?
"application/json"
:
"application/x-www-form-urlencoded"
,
"X-Authorization"
:
uni
.
getStorageSync
(
"uni-token"
)
};
},
success
(
args
)
{
uni
.
hideLoading
();
},
fail
(
err
)
{
formatAppLog
(
"log"
,
"at util/interceptor.ts:56"
,
"interceptor-fail"
,
err
);
formatAppLog
(
"log"
,
"at util/interceptor.ts:57"
,
"
\
u8BF7
\
u6C42
\
u5931
\
u8D25"
);
uni
.
hideLoading
();
},
complete
(
res
)
{
uni
.
hideLoading
();
}
});
};
var
request
=
(
url
,
method
,
params
)
=>
{
interceptor
();
return
new
Promise
((
resolve
,
reject
)
=>
{
uni
.
request
({
url
,
method
,
data
:
__spreadValues
({},
params
),
success
(
res
)
{
resolve
(
res
.
data
);
},
fail
(
err
)
{
reject
(
err
);
},
complete
()
{
uni
.
hideLoading
();
}
});
});
};
const
dev
=
{
base_url
:
"https://mdev.zuihuibi.cn"
,
api_url
:
"https://mdev.zuihuibi.cn/api"
,
sfp_url
:
"https://mdev.zuihuibi.cn/api/sfp"
};
const
stage
=
{
base_url
:
"https://mstage.zuihuibi.cn"
,
api_url
:
"https://mstage.zuihuibi.cn/api"
,
sfp_url
:
"https://mstage.zuihuibi.cn/api/sfp"
};
const
prod
=
{
base_url
:
"https://m.zuihuibi.cn"
,
api_url
:
"https://m.zuihuibi.cn/api"
,
sfp_url
:
"https://m.zuihuibi.cn/api/sfp"
};
const
config
=
{
dev
,
stage
,
prod
};
let
env
=
"dev"
;
let
baseURL
=
config
[
env
].
base_url
;
var
api
=
{
checkToken
()
{
const
params
=
{
token
:
uni
.
getStorageSync
(
"uni-token"
),
ticket
:
"uni-app"
};
return
request
(
`
${
baseURL
}
/api/authorize/checkToken`
,
"POST"
,
params
);
},
obtainToken
()
{
const
params
=
{
ticket
:
"uni-app"
};
return
request
(
`
${
baseURL
}
/api/authorize/obtainToken`
,
"POST"
,
params
);
},
verificationCode
(
params
)
{
return
request
(
`
${
baseURL
}
/api/verificationCode`
,
"POST"
,
params
);
},
loginVerification
(
params
)
{
return
request
(
`
${
baseURL
}
/api/verificationCode`
,
"POST"
,
params
);
}
};
var
common
=
{
mobileNoValid
(
no
)
{
const
MOBILE_REGEXP
=
/^
(
1
)\d{10}
$/
;
return
MOBILE_REGEXP
.
test
(
no
);
},
errorDialog
(
type
,
content
)
{
uni
.
showModal
({
title
:
type
===
1
?
"
\
u5FC5
\
u586B
\
u9879
\
u6821
\
u9A8C"
:
"
\
u89C4
\
u5219
\
u6821
\
u9A8C"
,
content
,
showCancel
:
false
,
success
:
function
(
res
)
{
if
(
res
.
confirm
)
{
formatAppLog
(
"log"
,
"at common/common.ts:15"
,
"
\
u7528
\
u6237
\
u70B9
\
u51FB
\
u786E
\
u5B9A"
);
}
else
if
(
res
.
cancel
)
{
formatAppLog
(
"log"
,
"at common/common.ts:17"
,
"
\
u7528
\
u6237
\
u70B9
\
u51FB
\
u53D6
\
u6D88"
);
}
}
});
}
};
var
_export_sfc
=
(
sfc
,
props
)
=>
{
var
_export_sfc
=
(
sfc
,
props
)
=>
{
const
target
=
sfc
.
__vccOpts
||
sfc
;
const
target
=
sfc
.
__vccOpts
||
sfc
;
for
(
const
[
key
,
val
]
of
props
)
{
for
(
const
[
key
,
val
]
of
props
)
{
...
@@ -48,39 +194,64 @@ if (uni.restoreGlobal) {
...
@@ -48,39 +194,64 @@ if (uni.restoreGlobal) {
loginType
:
"codelogin"
,
loginType
:
"codelogin"
,
passwordFlag
:
false
,
passwordFlag
:
false
,
loginTypeName
:
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
,
loginTypeName
:
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
,
countdown
:
60
,
remainTimes
:
60
,
sedCode
:
"
\
u83B7
\
u53D6
\
u9A8C
\
u8BC1
\
u7801"
sendCodeHtml
:
"
\
u83B7
\
u53D6
\
u9A8C
\
u8BC1
\
u7801"
,
form
:
{
mobile
:
null
,
code
:
null
,
password
:
null
,
invitation_code
:
null
},
disabledSendBtn
:
false
};
};
},
},
methods
:
{
methods
:
{
formReset
:
function
(
e
)
{
formReset
:
function
(
e
)
{
formatAppLog
(
"log"
,
"at components/login/login.vue:
69
"
,
"
\
u6E05
\
u7A7A
\
u6570
\
u636E"
);
formatAppLog
(
"log"
,
"at components/login/login.vue:
96
"
,
"
\
u6E05
\
u7A7A
\
u6570
\
u636E"
);
},
},
getLogin
()
{
getLogin
()
{
this
.
loginType
===
"codelogin"
?
this
.
loginType
=
"pwlogin"
:
this
.
loginType
=
"codelogin"
;
this
.
loginType
===
"codelogin"
?
this
.
loginType
=
"pwlogin"
:
this
.
loginType
=
"codelogin"
;
this
.
loginTypeName
=
this
.
loginType
==
"codelogin"
?
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
:
"
\
u5BC6
\
u7801
\
u767B
\
u5F55"
;
this
.
loginTypeName
=
this
.
loginType
==
"codelogin"
?
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
:
"
\
u5BC6
\
u7801
\
u767B
\
u5F55"
;
},
},
register
()
{
register
()
{
this
.
loginType
=
"register"
;
this
.
loginType
=
==
"register"
?
this
.
loginType
=
"resetpw"
:
this
.
loginType
=
"register"
;
this
.
loginTypeName
=
"
\
u6CE8
\
u518C
"
;
this
.
loginTypeName
=
this
.
loginType
==
"register"
?
"
\
u6CE8
\
u518C"
:
"
\
u91CD
\
u7F6E
\
u5BC6
\
u7801
"
;
},
},
sendMessage
()
{
sendMessage
()
{
debugger
;
const
params
=
{
mobileNo
:
this
.
form
.
mobile
,
type
:
"1"
};
if
(
common
.
mobileNoValid
(
this
.
form
.
mobile
)
&&
!
this
.
disabledSendBtn
)
{
api
.
verificationCode
(
params
).
then
((
res
)
=>
{
formatAppLog
(
"log"
,
"at components/login/login.vue:114"
,
res
);
if
(
res
[
"success"
])
{
this
.
delayTime
();
this
.
delayTime
();
}
});
}
else
{
common
.
errorDialog
(
2
,
"
\
u624B
\
u673A
\
u53F7
\
u6821
\
u9A8C
\
u9519
\
u8BEF"
);
}
},
},
delayTime
()
{
delayTime
()
{
if
(
this
.
countdown
==
0
)
{
this
.
disabledSendBtn
=
true
;
this
.
isValid
=
false
;
this
.
timer
=
setInterval
(()
=>
{
this
.
sedCode
=
"
\
u91CD
\
u65B0
\
u53D1
\
u9001"
;
this
.
remainTimes
--
;
this
.
countdown
=
60
;
this
.
sendCodeHtml
=
`
${
this
.
remainTimes
}
(S)`
;
}
else
{
if
(
this
.
remainTimes
<=
0
)
{
this
.
isValid
=
true
;
this
.
sendCodeHtml
=
"
\
u83B7
\
u53D6
\
u9A8C
\
u8BC1
\
u7801"
;
this
.
sedCode
=
this
.
countdown
+
"s"
;
this
.
remainTimes
=
60
;
this
.
countdown
--
;
this
.
disabledSendBtn
=
false
;
setTimeout
(()
=>
{
clearInterval
(
this
.
timer
);
this
.
delayTime
();
},
1
e3
);
}
}
},
1
e3
);
}
}
},
mounted
()
{
api
.
obtainToken
().
then
((
res
)
=>
{
formatAppLog
(
"log"
,
"at components/login/login.vue:141"
,
res
);
});
}
}
};
};
function
_sfc_render
(
_ctx
,
_cache
,
$props
,
$setup
,
$data
,
$options
)
{
function
_sfc_render
(
_ctx
,
_cache
,
$props
,
$setup
,
$data
,
$options
)
{
...
@@ -107,24 +278,33 @@ if (uni.restoreGlobal) {
...
@@ -107,24 +278,33 @@ if (uni.restoreGlobal) {
})
})
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
vue
.
createElementVNode
(
"view"
,
{
class
:
"inputItem"
},
[
vue
.
createElementVNode
(
"view"
,
{
class
:
"inputItem"
},
[
vue
.
createElementVNode
(
"input"
,
{
vue
.
withDirectives
(
vue
.
createElementVNode
(
"input"
,
{
class
:
"uni-input"
,
class
:
"uni-input"
,
name
:
"mobileNo"
,
name
:
"mobileNo"
,
placeholder
:
"
\
u8F93
\
u5165
\
u624B
\
u673A
\
u53F7"
placeholder
:
"
\
u8F93
\
u5165
\
u624B
\
u673A
\
u53F7"
,
})
"onUpdate:modelValue"
:
_cache
[
0
]
||
(
_cache
[
0
]
=
(
$event
)
=>
$data
.
form
.
mobile
=
$event
),
maxlength
:
"11"
},
null
,
512
),
[
[
vue
.
vModelText
,
$data
.
form
.
mobile
]
])
]),
]),
$data
.
loginType
===
"codelogin"
||
$data
.
loginType
===
"register"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
$data
.
loginType
===
"codelogin"
||
$data
.
loginType
===
"register"
||
$data
.
loginType
===
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
1
,
key
:
1
,
class
:
"inputItem"
class
:
"inputItem"
},
[
},
[
vue
.
createElementVNode
(
"input"
,
{
vue
.
withDirectives
(
vue
.
createElementVNode
(
"input"
,
{
class
:
"uni-input"
,
class
:
"uni-input"
,
name
:
"code"
,
name
:
"code"
,
placeholder
:
"
\
u8F93
\
u5165
\
u9A8C
\
u8BC1
\
u7801"
placeholder
:
"
\
u8F93
\
u5165
\
u9A8C
\
u8BC1
\
u7801"
,
}),
"onUpdate:modelValue"
:
_cache
[
1
]
||
(
_cache
[
1
]
=
(
$event
)
=>
$data
.
form
.
code
=
$event
),
type
:
"number"
},
null
,
512
),
[
[
vue
.
vModelText
,
$data
.
form
.
code
]
]),
vue
.
createElementVNode
(
"text"
,
{
vue
.
createElementVNode
(
"text"
,
{
onClick
:
_cache
[
0
]
||
(
_cache
[
0
]
=
(
$event
)
=>
$options
.
sendMessage
())
onClick
:
_cache
[
2
]
||
(
_cache
[
2
]
=
(
$event
)
=>
$options
.
sendMessage
()),
},
vue
.
toDisplayString
(
$data
.
sedCode
),
1
)
class
:
vue
.
normalizeClass
({
"grey"
:
$data
.
disabledSendBtn
})
},
vue
.
toDisplayString
(
$data
.
sendCodeHtml
),
3
)
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
$data
.
loginType
===
"pwlogin"
||
$data
.
loginType
===
"register"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
$data
.
loginType
===
"pwlogin"
||
$data
.
loginType
===
"register"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
2
,
key
:
2
,
...
@@ -147,15 +327,39 @@ if (uni.restoreGlobal) {
...
@@ -147,15 +327,39 @@ if (uni.restoreGlobal) {
}))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
}))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
$data
.
passwordFlag
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"text"
,
{
$data
.
passwordFlag
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"text"
,
{
key
:
2
,
key
:
2
,
onClick
:
_cache
[
1
]
||
(
_cache
[
1
]
=
(
$event
)
=>
$data
.
passwordFlag
=
false
)
onClick
:
_cache
[
3
]
||
(
_cache
[
3
]
=
(
$event
)
=>
$data
.
passwordFlag
=
false
)
},
"
\
u663E
\
u793A
\
u5BC6
\
u7801"
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
},
"
\
u663E
\
u793A
\
u5BC6
\
u7801"
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
!
$data
.
passwordFlag
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"text"
,
{
!
$data
.
passwordFlag
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"text"
,
{
key
:
3
,
key
:
3
,
onClick
:
_cache
[
2
]
||
(
_cache
[
2
]
=
(
$event
)
=>
$data
.
passwordFlag
=
true
)
onClick
:
_cache
[
4
]
||
(
_cache
[
4
]
=
(
$event
)
=>
$data
.
passwordFlag
=
true
)
},
"
\
u4E0D
\
u663E
\
u793A
\
u5BC6
\
u7801"
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
},
"
\
u4E0D
\
u663E
\
u793A
\
u5BC6
\
u7801"
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
vue
.
createCommentVNode
(
"
\
u91CD
\
u7F6E
\
u5BC6
\
u7801"
),
$data
.
loginType
===
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
3
},
[
vue
.
createElementVNode
(
"view"
,
{
class
:
"inputItem"
},
[
vue
.
createElementVNode
(
"input"
,
{
class
:
"uni-input"
,
type
:
"text"
,
password
:
""
,
name
:
"password"
,
placeholder
:
"
\
u5BC6
\
u7801(6-20
\
u4F4D
\
u5B57
\
u6BCD
\
u6570
\
u5B57
\
u7EC4
\
u5408)"
})
]),
vue
.
createElementVNode
(
"view"
,
{
class
:
"inputItem"
},
[
vue
.
createElementVNode
(
"input"
,
{
class
:
"uni-input"
,
type
:
"text"
,
password
:
""
,
name
:
"password"
,
placeholder
:
"
\
u518D
\
u6B21
\
u786E
\
u8BA4
\
u5BC6
\
u7801"
})
])
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
]),
]),
vue
.
createElementVNode
(
"view"
,
{
class
:
"agree"
},
[
$data
.
loginType
!=
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
0
,
class
:
"agree"
},
[
vue
.
createElementVNode
(
"icon"
,
{
vue
.
createElementVNode
(
"icon"
,
{
type
:
_ctx
.
radioUnselect
,
type
:
_ctx
.
radioUnselect
,
size
:
"26"
size
:
"26"
...
@@ -164,17 +368,28 @@ if (uni.restoreGlobal) {
...
@@ -164,17 +368,28 @@ if (uni.restoreGlobal) {
vue
.
createElementVNode
(
"a"
,
{
href
:
"#"
},
"
\
u94F6
\
u76FE
\
u4FDD
\
u9669
\
u7ECF
\
u7EAA
\
u670D
\
u52A1
\
u534F
\
u8BAE"
),
vue
.
createElementVNode
(
"a"
,
{
href
:
"#"
},
"
\
u94F6
\
u76FE
\
u4FDD
\
u9669
\
u7ECF
\
u7EAA
\
u670D
\
u52A1
\
u534F
\
u8BAE"
),
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u548C"
),
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u548C"
),
vue
.
createElementVNode
(
"a"
,
{
href
:
""
},
"
\
u9690
\
u79C1
\
u653F
\
u7B56"
)
vue
.
createElementVNode
(
"a"
,
{
href
:
""
},
"
\
u9690
\
u79C1
\
u653F
\
u7B56"
)
]),
]))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
vue
.
createElementVNode
(
"view"
,
{
class
:
"login_btn"
},
vue
.
toDisplayString
(
$data
.
loginType
==
"register"
?
"
\
u6CE8
\
u518C"
:
"
\
u767B
\
u5F55"
),
1
),
$data
.
loginType
!=
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
vue
.
createElementVNode
(
"view"
,
{
class
:
"login_type"
},
[
key
:
1
,
class
:
"login_btn"
,
onClick
:
_cache
[
5
]
||
(
_cache
[
5
]
=
(
$event
)
=>
_ctx
.
loginIn
())
},
vue
.
toDisplayString
(
$data
.
loginType
==
"register"
?
"
\
u6CE8
\
u518C"
:
"
\
u767B
\
u5F55"
)
+
" "
+
vue
.
toDisplayString
(
$data
.
loginType
),
1
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
$data
.
loginType
==
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
2
,
class
:
"login_btn"
},
"
\
u4FDD
\
u5B58 "
))
:
vue
.
createCommentVNode
(
"v-if"
,
true
),
$data
.
loginType
!=
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
3
,
class
:
"login_type"
},
[
vue
.
createElementVNode
(
"text"
,
{
vue
.
createElementVNode
(
"text"
,
{
onClick
:
_cache
[
3
]
||
(
_cache
[
3
]
=
(
$event
)
=>
$options
.
getLogin
())
onClick
:
_cache
[
6
]
||
(
_cache
[
6
]
=
(
$event
)
=>
$options
.
getLogin
())
},
vue
.
toDisplayString
(
$data
.
loginType
==
"pwlogin"
||
$data
.
loginType
==
"register"
?
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
:
"
\
u5BC6
\
u7801
\
u767B
\
u5F55"
),
1
),
},
vue
.
toDisplayString
(
$data
.
loginType
==
"pwlogin"
||
$data
.
loginType
==
"register"
?
"
\
u9A8C
\
u8BC1
\
u7801
\
u767B
\
u5F55"
:
"
\
u5BC6
\
u7801
\
u767B
\
u5F55"
),
1
),
vue
.
createElementVNode
(
"text"
,
{
vue
.
createElementVNode
(
"text"
,
{
onClick
:
_cache
[
4
]
||
(
_cache
[
4
]
=
(
$event
)
=>
$options
.
register
())
onClick
:
_cache
[
7
]
||
(
_cache
[
7
]
=
(
$event
)
=>
$options
.
register
())
},
vue
.
toDisplayString
(
$data
.
loginType
==
"codelogin"
?
"
\
u7ACB
\
u5373
\
u6CE8
\
u518C"
:
"
\
u5FD8
\
u8BB0
\
u5BC6
\
u7801"
),
1
)
},
vue
.
toDisplayString
(
$data
.
loginType
==
"codelogin"
?
"
\
u7ACB
\
u5373
\
u6CE8
\
u518C"
:
"
\
u5FD8
\
u8BB0
\
u5BC6
\
u7801"
),
1
)
]),
])
)
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
,
vue
.
createElementVNode
(
"view"
,
null
,
[
$data
.
loginType
!=
"resetpw"
?
(
vue
.
openBlock
(),
vue
.
createElementBlock
(
"view"
,
{
key
:
4
}
,
[
vue
.
createElementVNode
(
"view"
,
{
class
:
"other_login"
},
[
vue
.
createElementVNode
(
"view"
,
{
class
:
"other_login"
},
[
vue
.
createElementVNode
(
"text"
,
{
class
:
"text_line"
}),
vue
.
createElementVNode
(
"text"
,
{
class
:
"text_line"
}),
vue
.
createElementVNode
(
"text"
,
{
style
:
{
"margin"
:
"0 40rpx"
,
"position"
:
"relative"
,
"top"
:
"10rpx"
}
},
"
\
u5176
\
u4ED6
\
u767B
\
u5F55"
),
vue
.
createElementVNode
(
"text"
,
{
style
:
{
"margin"
:
"0 40rpx"
,
"position"
:
"relative"
,
"top"
:
"10rpx"
}
},
"
\
u5176
\
u4ED6
\
u767B
\
u5F55"
),
...
@@ -184,7 +399,7 @@ if (uni.restoreGlobal) {
...
@@ -184,7 +399,7 @@ if (uni.restoreGlobal) {
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u6E38
\
u5BA2"
),
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u6E38
\
u5BA2"
),
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u4EE3
\
u7406
\
u5546"
)
vue
.
createElementVNode
(
"text"
,
null
,
"
\
u4EE3
\
u7406
\
u5546"
)
])
])
])
])
)
:
vue
.
createCommentVNode
(
"v-if"
,
true
)
])
])
]);
]);
}
}
...
...
unpackage/dist/dev/app-plus/components/login/login.css
View file @
e6d1d1d5
...
@@ -78,6 +78,9 @@
...
@@ -78,6 +78,9 @@
top
:
0.625rem
;
top
:
0.625rem
;
color
:
#20279B
;
color
:
#20279B
;
}
}
.wrapper
.content
uni-form
.inputItem
.grey
{
color
:
#CECECE
;
}
.wrapper
.content
.agree
{
.wrapper
.content
.agree
{
font-size
:
0.875rem
;
font-size
:
0.875rem
;
color
:
#666
;
color
:
#666
;
...
...
unpackage/dist/dev/app-plus/manifest.json
View file @
e6d1d1d5
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
}
}
}
}
},
},
"arguments"
:
"{
\"
path
\"
:
\"
components/login/login
\"
}"
,
"uniStatistics"
:
{
"uniStatistics"
:
{
"enable"
:
false
"enable"
:
false
},
},
...
...
util/interceptor.ts
View file @
e6d1d1d5
...
@@ -10,7 +10,7 @@ export const interceptor = () => {
...
@@ -10,7 +10,7 @@ export const interceptor = () => {
// 请求拦截器
// 请求拦截器
invoke
(
args
)
{
invoke
(
args
)
{
//
console.log('请求拦截器',args);
console
.
log
(
'请求拦截器'
,
args
);
// 加载loading
// 加载loading
uni
.
showLoading
({
uni
.
showLoading
({
title
:
'加载中...'
title
:
'加载中...'
...
@@ -28,7 +28,7 @@ export const interceptor = () => {
...
@@ -28,7 +28,7 @@ export const interceptor = () => {
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'data'
][
'token'
]);
uni
.
setStorageSync
(
'uni-token'
,
res
.
data
[
'data'
][
'token'
]);
window
.
location
.
href
=
window
.
location
.
href
+
'?'
+
't_reload='
+
new
Date
().
getTime
();
window
.
location
.
href
=
window
.
location
.
href
+
'?'
+
't_reload='
+
new
Date
().
getTime
();
}
}
//
console.log(res)
console
.
log
(
res
)
},
fail
(
err
)
{
},
fail
(
err
)
{
reject
(
err
);
reject
(
err
);
},
},
...
...
util/router.js
0 → 100644
View file @
e6d1d1d5
//只要是未登录状态,想要跳转到名单内的路径时,直接跳到登录页
// 页面白名单,不受拦截
const
whiteList
=
[
'/components/login/login'
,
'/pages/index/index'
]
export
default
function
initApp
(){
uni
.
addInterceptor
(
'navigateTo'
,
{
// 页面跳转前进行拦截, invoke根据返回值进行判断是否继续执行跳转
invoke
(
e
)
{
if
(
!
hasPermission
(
e
.
url
)){
uni
.
reLaunch
({
url
:
'/components/login/login'
})
return
false
}
return
true
},
success
(
e
)
{
}
})
uni
.
addInterceptor
(
'switchTab'
,
{
// tabbar页面跳转前进行拦截
invoke
(
e
)
{
if
(
!
hasPermission
(
e
.
url
)){
uni
.
reLaunch
({
url
:
'/components/login/login'
})
return
false
}
return
true
},
success
(
e
)
{
}
})
}
function
hasPermission
(
url
)
{
let
islogin
=
uni
.
getStorageSync
(
"isLogin"
);
//在这可以使用token、vuex
islogin
=
Boolean
(
Number
(
islogin
));
//返回布尔值
// 在白名单中或有登录判断条件可以直接跳转
if
(
whiteList
.
indexOf
(
url
)
!==
-
1
||
islogin
)
{
return
true
}
return
false
}
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