培训考核三期,新版培训,网页版培训登录器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

122 lines
4.0 KiB

using Newtonsoft.Json;
using System.Diagnostics;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
/*
角色适配: 1.指挥员(长)指挥能力考评系统 角色类型 0.管理员1.考官2.考生
2.消防救援单位信息考核系统 角色类型 0.管理员1.教员2.学员
3.中高级指挥长考评系统 角色类型 -1.超级管理员0.学员1.教员2.管理员
*/
public class SystemPath
{
public string pathPX;//培训考核系统
public string pathJY;//消防救援考核(网页端)
public string pahtKP;//考评系统(3期带视频编辑滑块)
public string pathPXAdmin;//培训考核系统管理员
}
public class SelectPanelManager : MonoBehaviour
{
public Button KaoHe_1;//培训考核系统
public Button KaoHe_2;//消防救援考核(网页端)
public Button KaoHe_3;//考评系统(3期带视频编辑滑块)
private string password;
private SystemPath paths;
void Start()
{
var systemfilepath = Application.streamingAssetsPath + @"/SystemPath.json";
LoadFileHelper.Instance.LoadFileStringSync(systemfilepath, (s) =>
{
paths = JsonConvert.DeserializeObject<SystemPath>(s);
});
KaoHe_1.onClick.AddListener(KaoHe_1_Click);
KaoHe_2.onClick.AddListener(KaoHe_2_Click);
KaoHe_3.onClick.AddListener(KaoHe_3_Click);
}
private void KaoHe_3_Click()
{
string path = Path.Combine(Application.streamingAssetsPath, paths.pahtKP);
string args = " cmd";
args += " ";
args += HTTPRequestManager.Instance.userName;
args += " ";
args += password;
args += " ";
int role = (int)HTTPRequestManager.Instance.identityInfo.roleType;
args += role;
UnityEngine.Debug.Log(args);
Process.Start(path, args);
}
private void KaoHe_2_Click()
{
/*角色适配: 1.指挥员(长)指挥能力考评系统 角色类型 0.管理员1.考官2.考生
2.消防救援单位信息考核系统 角色类型 0.管理员1.教员2.学员
3.中高级指挥长考评系统 角色类型 -1.超级管理员0.学员1.教员2.管理员*/
string path = paths.pathJY;
path += $"?loginName={HTTPRequestManager.Instance.userName}";
var roletype = HTTPRequestManager.Instance.identityInfo.roleType;
int role = 0;
if (roletype == RoleType.)
{
role = 2;
}
else if (roletype == RoleType.)
{
role = 1;
}
else
{
role = 0;
}
path += $"&roleType={role}";
path += $"&token={HTTPRequestManager.Instance.identityInfo.token}";
WWW www = new WWW(path);
Application.OpenURL(www.url);
}
public void OnShow(string pwd)
{
password = pwd;
}
private void KaoHe_1_Click()
{
/*角色适配: 1.指挥员(长)指挥能力考评系统 角色类型 0.管理员1.考官2.考生
2.消防救援单位信息考核系统 角色类型 0.管理员1.教员2.学员
3.中高级指挥长考评系统 角色类型 -1.超级管理员0.学员1.教员2.管理员*/
var roletype = HTTPRequestManager.Instance.identityInfo.roleType;
string path;
int role = 0;
if (roletype == RoleType.)
{
role = 2;
path = Path.Combine(Application.streamingAssetsPath, paths.pathPX);
}
else if (roletype == RoleType.)
{
role = 1;
path = Path.Combine(Application.streamingAssetsPath, paths.pathPX);
}
else
{
role = 0;
path = Path.Combine(Application.streamingAssetsPath, paths.pathPXAdmin);
}
string args = " cmd";
args += " ";
args += HTTPRequestManager.Instance.userName;
args += " ";
args += role;
args += " ";
args += HTTPRequestManager.Instance.identityInfo.token;
UnityEngine.Debug.Log(args);
Process.Start(path, args);
}
}