|
@@ -7,11 +7,19 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
+ config
|
|
|
+ } from '@/api/request/config.js'
|
|
|
+ import {
|
|
|
+ authGetAppletUser,
|
|
|
configInfo,
|
|
|
getConfigByType,
|
|
|
systemAppletRolePermission,
|
|
|
securityDataStatisticsGetUserIdentity
|
|
|
} from '@/pages/api/index.js'
|
|
|
+ import {
|
|
|
+ Encrypt,
|
|
|
+ Decrypt
|
|
|
+ } from '@/utils/secret.js'
|
|
|
export default {
|
|
|
name: "ssoCertification",
|
|
|
data() {
|
|
@@ -24,7 +32,7 @@
|
|
|
if(option.token){
|
|
|
uni.setStorageSync('token', option.token);
|
|
|
//获取登录人信息接口
|
|
|
- this.getUserInfo();
|
|
|
+ this.authGetAppletUser();
|
|
|
}else{
|
|
|
uni.redirectTo({
|
|
|
url: '/pages/views/login/ssoLogin',
|
|
@@ -34,40 +42,54 @@
|
|
|
mounted() {
|
|
|
|
|
|
},
|
|
|
-
|
|
|
methods: {
|
|
|
- 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',
|
|
|
+ async authGetAppletUser(){
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await authGetAppletUser();
|
|
|
+ if (data.code == 200) {
|
|
|
+ uni.setStorageSync('dataBoardType', false);
|
|
|
+ uni.setStorageSync('userId', data.data.userId);
|
|
|
+ uni.setStorageSync('isInitPwd', true);
|
|
|
+ // userType 0-系统 1-教职工 2-学生 3-大屏
|
|
|
+ uni.setStorageSync('userType', data.data.userType == 0 || data.data.userType == 1 ? '1' :
|
|
|
+ (data.data.userType == 2 ? '2' : (data.data.userType == 3 ? '3' : 'none')));
|
|
|
+ //等待配置与字段获取到后跳转
|
|
|
+ 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
|
|
|
});
|
|
|
- }
|
|
|
- }).catch((error) => {
|
|
|
- wx.showToast({
|
|
|
- title: '数据异常,请稍候再试!',
|
|
|
- icon: "none",
|
|
|
- duration: 3000
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ uni.redirectTo({
|
|
|
+ url: '/pages/views/home/home',
|
|
|
});
|
|
|
- })
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
//查询公共配置
|
|
@@ -124,6 +146,18 @@
|
|
|
uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
|
|
|
}
|
|
|
},
|
|
|
+ //获取权限字段
|
|
|
+ async systemAppletRolePermission() {
|
|
|
+ let self = this;
|
|
|
+ const {
|
|
|
+ data
|
|
|
+ } = await systemAppletRolePermission();
|
|
|
+ if (data.code == 200) {
|
|
|
+ uni.setStorageSync('permissions', data.data.data)
|
|
|
+ uni.setStorageSync('controlsRestrict', data.data.roleKeys ? data.data.roleKeys : [])
|
|
|
+ uni.setStorageSync('user', data.data.userInfo)
|
|
|
+ }
|
|
|
+ },
|
|
|
//查询身份
|
|
|
async securityDataStatisticsGetUserIdentity(routeUrl) {
|
|
|
let self = this;
|