Bladeren bron

手机端sso

北屯中职分支
liangkun 1 jaar geleden
bovenliggende
commit
a0de606c0b
6 gewijzigde bestanden met toevoegingen van 608 en 0 verwijderingen
  1. +200
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/attestation.vue
  2. +119
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/list.vue
  3. +26
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/listview.vue
  4. +163
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp20/attestation.vue
  5. +100
    -0
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp20/list.vue
  6. BIN
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/static/SSO/attes.png

+ 200
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/attestation.vue Bestand weergeven

@@ -0,0 +1,200 @@
<template>
<view class="wrap">
<view class="imgwrap">
<image src="@/static/SSO/attes.png" mode=""></image>
</view>
<view class="title">IDENTITY AUTHENTICATION</view>
<view class="titletext">统一身份认证平台</view>

<view>
<view v-if="firsttype">
<view class="loading">系统认证中,请耐心等待......</view>
</view>
<view v-else>
<view class="logintitle">用户登录</view>
<view class="logintext">首次登录,请输入账号密码。</view>
<view class="account" style="margin-top: 30rpx;">
<view>账号:</view>
<input v-model="UPUserName" class="uni-input" focus placeholder="请输入账号" />
</view>
<view class="account">
<view>密码:</view>
<input v-model="UPPass" class="uni-input" password="" placeholder="请输入密码" />
</view>
<view class="btnwrap">
<button @click="register">登录</button>
</view>
</view>
</view>



</view>
</template>

<script>
export default {
data() {
return {
dataitem: '',
sysid: '',
openid: '',
firsttype: true,
UPUserName: '',
UPPass: '',
UPId: '',
FId: '',
UserId: ''
}
},
onLoad(data) {
this.dataitem = JSON.parse(data.item)
this.sysid = this.dataitem.sysid;
this.openid = this.dataitem.openid;
setTimeout(() => {
this.gotolist(this.sysid, this.openid)
}, 1000)

},
methods: {
gotolist(sysid, openid) {
let _this = this
// const { sysid,openid } = this
this.HTTP_GET(
'quanjiang/sso/goto', {
sysid,
openid
},
'加载数据时出错'
).then(res => {
let item = {
FInterfaceUrl: res.FInterfaceUrl,
FName: _this.dataitem.FName
}
if (res.FInterfaceUrl.indexOf('http') != -1) {
uni.redirectTo({
// url:`/pages/SSO/MyApp/listview?FInterfaceUrl=${item.FInterfaceUrl}&FName=${item.FName}`
url: `/pages/SSO/MyApp/listview?data=` + encodeURIComponent(JSON.stringify(
item))
})
} else {
let sysid = item.FInterfaceUrl.slice(item.FInterfaceUrl.indexOf('=') + 1, item
.FInterfaceUrl.indexOf('&'))
let openid = item.FInterfaceUrl.slice(item.FInterfaceUrl.lastIndexOf('=') + 1)
this.HTTP_GET(
'quanjiang/sso/first', {
sysid,
openid
},
'加载数据时出错'
).then(resitem => {
_this.firsttype = false
_this.UPId = resitem.UPId
_this.FId = resitem.FId
_this.UserId = resitem.UserId
})
}
})

},
register() {
let _this = this
let {UPId,UPUserName,UPPass,FId,UserId} = this
if (UPUserName && UPPass) {
_this.HTTP_POST(
'quanjiang/sso/first', {UPId,FId,UserId,UPUserName,UPPass},'加载数据时出错').then(resitem => {
let sysid = resitem.FInterfaceUrl.slice(resitem.FInterfaceUrl.indexOf('=') + 1, resitem
.FInterfaceUrl.indexOf('&'))
let openid = resitem.FInterfaceUrl.slice(resitem.FInterfaceUrl.lastIndexOf('=') + 1)
this.gotolist(sysid, openid)
})
} else {
this.CONFIRM('账号或密码不能为空')
}


}
}
}
</script>

<style lang="less">
.imgwrap {
width: 214rpx;
margin: 0 auto;
padding-top: 100rpx;
font-size: 0;
}

.imgwrap image {
width: 214rpx;
height: 200rpx;
display: block;
}

.title {
font-size: 24rpx;
text-align: center;
margin-top: 40rpx;
color: gray;
}

.titletext {
font-size: 50rpx;
text-align: center;
margin-top: 20rpx;
}

.loading {
font-size: 28rpx;
text-align: center;
margin-top: 50rpx;
color: goldenrod;
}

.logintitle {
font-size: 36rpx;
text-align: center;
margin-top: 90rpx;
color: gray;
}

.logintext {
font-size: 28rpx;
text-align: center;
margin-top: 30rpx;
color: goldenrod;
}

.account {
display: flex;
align-items: center;
margin-top: 30rpx;
justify-content: center;
}

.account view {
font-size: 38rpx;
}

.account input {
border: 1px solid #ccc;
height: 80rpx;
font-size: 30rpx;
width: 450rpx;
padding-left: 20rpx;
}

.btnwrap {}

.btnwrap button {
width: 50%;
line-height: 50px;
background-color: #0c86d8;
text-align: center;
color: #fff;
border-radius: 4px;
margin: 40px auto;
font-size: 40rpx;
}
</style>

+ 119
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/list.vue Bestand weergeven

@@ -0,0 +1,119 @@
<template>
<view class="page" id="more">

<!-- 分块显示功能区 -->
<template v-for="(group, title) in listitem">
<view :key="title" class="margin-bottom">
<!-- 区块标题 -->
<l-title>{{ group.FTName }}</l-title>
<!-- 按钮组 -->
<view class="function-list cu-list grid no-border col-4">
<view v-for="(item, index) in group.PermFunction" :key="index"
class="cu-item text-center flex flex-wrap justify-center align-center">
<view @click="funcListClick(item)" style="backgroundColor:#62bbff;"
class="app-item align-center flex flex-wrap justify-center align-center">
<l-icon type="calendar" color="white" class="text-sl" />
</view>
<text>{{ item && item.FName }}</text>
</view>
</view>
</view>
</template>
</view>
</template>

<script>
import without from 'lodash/without'
import concat from 'lodash/concat'
import keyBy from 'lodash/keyBy'
import mapKeys from 'lodash/mapKeys'
import mapValues from 'lodash/mapValues'
import groupBy from 'lodash/groupBy'

export default {
data() {
return {
allList: [],
myList: [],
editList: [],
searchText: '',
listitem: [],
focus: false,
edit: false
}
},

async onLoad() {
await this.init()
},

methods: {
// 页面初始化
async init() {
this.LOADING('加载菜单中…')
this.HTTP_GET(
'quanjiang/sso/list'
).then(res => {
this.listitem = res
this.HIDE_LOADING()
})
},

// 点击按钮
funcListClick(item) {
if(item.FInterfaceUrl.indexOf('http')!=-1){
let option = {
FInterfaceUrl:item.FInterfaceUrl,
FName:item.FName
}
uni.navigateTo({
url:`/pages/SSO/MyApp/listview?data=`+ encodeURIComponent(JSON.stringify(option))
})
}else{
console.log(item.FInterfaceUrl)
let FInterfaceUrldata = item.FInterfaceUrl
if(FInterfaceUrldata.indexOf('sysid')!=-1 && FInterfaceUrldata.indexOf('openid')!=-1 ){
let sysid = item.FInterfaceUrl.slice(item.FInterfaceUrl.indexOf('sysid')+6,item.FInterfaceUrl.indexOf('openid')-1)
let openid = item.FInterfaceUrl.slice(item.FInterfaceUrl.lastIndexOf ('openid')+7)
let FName = item.FName
let dataitem = {
sysid,openid,FName
}
console.log(dataitem)
uni.navigateTo({
url:`/pages/SSO/MyApp/attestation?item=${JSON.stringify(dataitem)}`
})
}
}
},

}
}
</script>

<style lang="less" scoped>
.function-list {
padding-bottom: 0;

.cu-item {
.app-item {
border-radius: 50%;
height: 45px;
width: 45px;
}
}
}
</style>

<style lang="less">
#more {
.function-list .cu-item text[class*='cuIcon'] {
margin-top: 0 !important;
}
}

page {
// padding-top: 100rpx;
}
</style>

+ 26
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp/listview.vue Bestand weergeven

@@ -0,0 +1,26 @@
<template>
<view>
<web-view :src="url"></web-view>
</view>
</template>

<script>
export default {
data() {
return {
dataitem: '',
url: ''
}
},
onLoad(option) {
let dataitem = JSON.parse(option.data)
this.url = dataitem.FInterfaceUrl
uni.setNavigationBarTitle({
title: dataitem.FName
})
}
}
</script>

<style>
</style>

+ 163
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp20/attestation.vue Bestand weergeven

@@ -0,0 +1,163 @@
<template>
<view class="wrap">
<view class="imgwrap">
<image src="@/static/SSO/attes.png" mode=""></image>
</view>
<view class="title">IDENTITY AUTHENTICATION</view>
<view class="titletext">统一身份认证平台</view>

<view>
<view v-if="firsttype">
<view class="loading">系统认证中,请耐心等待......</view>
</view>
<view v-else>
<view class="logintitle">用户登录</view>
<view class="logintext">首次登录,请输入账号密码。</view>
<view class="account" style="margin-top: 30rpx;">
<view>账号:</view>
<input v-model="UPUserName" class="uni-input" focus placeholder="请输入账号" />
</view>
<view class="account">
<view>密码:</view>
<input v-model="UPPass" class="uni-input" password="" placeholder="请输入密码" />
</view>
<view class="btnwrap">
<button @click="register">登录</button>
</view>
</view>
</view>



</view>
</template>

<script>
export default {
data() {
return {
dataitem: '',
FName: '',
appid: '',
firsttype: true,
UPUserName: '',
UPPass: '',
UPId: '',
FId: '',
UserId: ''
}
},
onLoad(data) {
this.dataitem = JSON.parse(data.item)
this.FName = this.dataitem.FName;
this.appid = this.dataitem.appid;
setTimeout(() => {
this.gotolist()
}, 1000)

},
methods: {
gotolist() {
let _this = this
const { appid } = this
// console.log(appid)
this.HTTP_GET(
'quanjiang/sso/goto20', {
appid
},
'加载数据时出错'
).then(res => {
let option = {
FInterfaceUrl:res.FInterfaceUrl,
FName:this.FName
}
uni.redirectTo({
url:`/pages/SSO/MyApp/listview?data=`+ encodeURIComponent(JSON.stringify(option))
})
})

}
}
}
</script>

<style lang="less">
.imgwrap {
width: 214rpx;
margin: 0 auto;
padding-top: 100rpx;
font-size: 0;
}

.imgwrap image {
width: 214rpx;
height: 200rpx;
display: block;
}

.title {
font-size: 24rpx;
text-align: center;
margin-top: 40rpx;
color: gray;
}

.titletext {
font-size: 50rpx;
text-align: center;
margin-top: 20rpx;
}

.loading {
font-size: 28rpx;
text-align: center;
margin-top: 50rpx;
color: goldenrod;
}

.logintitle {
font-size: 36rpx;
text-align: center;
margin-top: 90rpx;
color: gray;
}

.logintext {
font-size: 28rpx;
text-align: center;
margin-top: 30rpx;
color: goldenrod;
}

.account {
display: flex;
align-items: center;
margin-top: 30rpx;
justify-content: center;
}

.account view {
font-size: 38rpx;
}

.account input {
border: 1px solid #ccc;
height: 80rpx;
font-size: 30rpx;
width: 450rpx;
padding-left: 20rpx;
}

.btnwrap {}

.btnwrap button {
width: 50%;
line-height: 50px;
background-color: #0c86d8;
text-align: center;
color: #fff;
border-radius: 4px;
margin: 40px auto;
font-size: 40rpx;
}
</style>

+ 100
- 0
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/SSO/MyApp20/list.vue Bestand weergeven

@@ -0,0 +1,100 @@
<template>
<view class="page" id="more">
<view class="function-list cu-list grid no-border col-4">
<view v-for="(item, index) in listitem" :key="index"
class="cu-item text-center flex flex-wrap justify-center align-center">
<view @click="funcListClick(item)" style="backgroundColor:#62bbff;"
class="app-item align-center flex flex-wrap justify-center align-center">
<l-icon type="calendar" color="white" class="text-sl" />
</view>
<text>{{ item && item.FName }}</text>
</view>
</view>
</view>
</template>

<script>
import without from 'lodash/without'
import concat from 'lodash/concat'
import keyBy from 'lodash/keyBy'
import mapKeys from 'lodash/mapKeys'
import mapValues from 'lodash/mapValues'
import groupBy from 'lodash/groupBy'

export default {
data() {
return {
allList: [],
myList: [],
editList: [],
searchText: '',

listitem: [],
focus: false,
edit: false
}
},

async onLoad() {
await this.init()
},

methods: {
// 页面初始化
async init() {

this.LOADING('加载菜单中…')
this.HTTP_GET(
'quanjiang/sso/list20'
).then(res => {
this.listitem = res
this.HIDE_LOADING()
})
},



// 点击按钮
funcListClick(item) {
let appid = item.FId
let FName = item.FName
let dataitem = {
appid,FName
}
uni.navigateTo({
url:`/pages/SSO/MyApp20/attestation?item=${JSON.stringify(dataitem)}`
})
},

}
}
</script>

<style lang="less" scoped>
.function-list {
padding-bottom: 0;

.cu-item {
.app-item {
border-radius: 50%;
height: 45px;
width: 45px;
}
}
}
</style>

<style lang="less">
#more {
.function-list .cu-item text[class*='cuIcon'] {
margin-top: 0 !important;
}
}

page {
// padding-top: 100rpx;
}
</style>

BIN
Learun.Framework.Ultimate V7/LearunApp-2.2.0/static/SSO/attes.png Bestand weergeven

Voor Na
Breedte: 107  |  Hoogte: 100  |  Grootte: 6.8 KiB

Laden…
Annuleren
Opslaan