|
@@ -1,4 +1,4 @@
|
|
-<!--扫描二维码页面-->
|
|
|
|
|
|
+<!--认证页面-->
|
|
<template>
|
|
<template>
|
|
<view id="ssoCertification">
|
|
<view id="ssoCertification">
|
|
登录中请稍后
|
|
登录中请稍后
|
|
@@ -6,6 +6,12 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {
|
|
|
|
+ configInfo,
|
|
|
|
+ getConfigByType,
|
|
|
|
+ systemAppletRolePermission,
|
|
|
|
+ securityDataStatisticsGetUserIdentity
|
|
|
|
+ } from '@/pages/api/index.js'
|
|
export default {
|
|
export default {
|
|
name: "ssoCertification",
|
|
name: "ssoCertification",
|
|
data() {
|
|
data() {
|
|
@@ -31,7 +37,124 @@
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
getUserInfo(){
|
|
getUserInfo(){
|
|
-
|
|
|
|
|
|
+ //等待配置与字段获取到后跳转
|
|
|
|
+ Promise.all([
|
|
|
|
+ //查询公共配置
|
|
|
|
+ this.getConfigInfo(),
|
|
|
|
+ //获取开发配置
|
|
|
|
+ this.getConfigByType(),
|
|
|
|
+ //获取权限字段
|
|
|
|
+ this.systemAppletRolePermission(),
|
|
|
|
+ //查询身份
|
|
|
|
+ this.securityDataStatisticsGetUserIdentity()
|
|
|
|
+ ]).then((result) => {
|
|
|
|
+ if (uni.getStorageSync('codeData')) {
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/views/saoCode/saoCode',
|
|
|
|
+ });
|
|
|
|
+ } else if (uni.getStorageSync('warningId')) {
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages_basics/views/earlyWarningManage/earlyWarningDetail',
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ uni.redirectTo({
|
|
|
|
+ url: '/pages/views/home/home',
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }).catch((error) => {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '数据异常,请稍候再试!',
|
|
|
|
+ icon: "none",
|
|
|
|
+ duration: 3000
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ //查询公共配置
|
|
|
|
+ async getConfigInfo() {
|
|
|
|
+ const {
|
|
|
|
+ data
|
|
|
|
+ } = await configInfo({
|
|
|
|
+ type: '1,2,4'
|
|
|
|
+ });
|
|
|
|
+ if (data.code == 200) {
|
|
|
|
+ let list = JSON.parse(data.data)
|
|
|
|
+ let newData = {};
|
|
|
|
+ list.forEach((item) => {
|
|
|
|
+ let obj = JSON.parse(item.configValue)
|
|
|
|
+ newData = {
|
|
|
|
+ ...newData,
|
|
|
|
+ ...obj
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ uni.setStorageSync('circularLogo', config.base_url + newData.circularLogo)
|
|
|
|
+ uni.setStorageSync('rectangleLogo', config.base_url + newData.rectangleLogo)
|
|
|
|
+ uni.setStorageSync('videoCover', config.base_url + newData.videoCover)
|
|
|
|
+ this.$set(this, 'loginBanner', config.base_url + newData.loginBanner);
|
|
|
|
+ uni.setStorageSync('loginBanner', config.base_url + newData.loginBanner)
|
|
|
|
+ this.$set(this, 'supplierType', newData.supplier);
|
|
|
|
+ uni.setStorageSync('supplierType', newData.supplier)
|
|
|
|
+ uni.setStorageSync('homepageBanner', config.base_url + newData.homepageBanner)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //获取开发配置
|
|
|
|
+ async getConfigByType() {
|
|
|
|
+ const {
|
|
|
|
+ data
|
|
|
|
+ } = await getConfigByType({
|
|
|
|
+ category: 2,
|
|
|
|
+ configType: 5
|
|
|
|
+ });
|
|
|
|
+ if (data.code == 200) {
|
|
|
|
+ let obj = JSON.parse(data.data.configValue)
|
|
|
|
+ //文件预览地址
|
|
|
|
+ uni.setStorageSync('filePreviewUrl', 'https://' + obj.fileExtranetUrl)
|
|
|
|
+ //小程序视频地址
|
|
|
|
+ uni.setStorageSync('cameraExtranetAgent', 'https://' + obj.cameraExtranetAgent)
|
|
|
|
+ //MQTT地址
|
|
|
|
+ uni.setStorageSync('mqttUrl', Decrypt(obj.mqttExtranetUrl))
|
|
|
|
+ //MQTT地址-内网
|
|
|
|
+ uni.setStorageSync('mqttIntranetUrl', Decrypt(obj.mqttIntranetUrl))
|
|
|
|
+ //MQTT账号
|
|
|
|
+ uni.setStorageSync('mqttUser', Decrypt(obj.mqttExtranetUser))
|
|
|
|
+ //MQTT密码
|
|
|
|
+ uni.setStorageSync('mqttPassword', Decrypt(obj.mqttExtranetPassword))
|
|
|
|
+ //文件浏览环境
|
|
|
|
+ uni.setStorageSync('fileBrowseEnvironment','http://'+Decrypt(obj.fileBrowseEnvironment))
|
|
|
|
+ uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ //查询身份
|
|
|
|
+ async securityDataStatisticsGetUserIdentity(routeUrl) {
|
|
|
|
+ let self = this;
|
|
|
|
+ const {
|
|
|
|
+ data
|
|
|
|
+ } = await securityDataStatisticsGetUserIdentity();
|
|
|
|
+ if(data.schoolAdmin){
|
|
|
|
+ //校级管理员
|
|
|
|
+ uni.setStorageSync('identityData',{
|
|
|
|
+ type:'schoolAdmin'
|
|
|
|
+ });
|
|
|
|
+ }else if(data.collegeAdmin){
|
|
|
|
+ //院级管理员
|
|
|
|
+ uni.setStorageSync('identityData',{
|
|
|
|
+ type:'collegeAdmin'
|
|
|
|
+ });
|
|
|
|
+ }else if(data.schoolGroup){
|
|
|
|
+ //校级督导组
|
|
|
|
+ uni.setStorageSync('identityData',{
|
|
|
|
+ type:'schoolGroup',
|
|
|
|
+ groupIds:data.groupIds
|
|
|
|
+ });
|
|
|
|
+ }else if(data.collegeGroup){
|
|
|
|
+ //院级督导组
|
|
|
|
+ uni.setStorageSync('identityData',{
|
|
|
|
+ type:'collegeGroup',
|
|
|
|
+ groupIds:data.groupIds
|
|
|
|
+ });
|
|
|
|
+ }else{
|
|
|
|
+ uni.removeStorageSync('identityData');
|
|
|
|
+ }
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|