Commit 69e484e6 by 展昭

对接数据,修改对接方法.

parent 92743715
VUE_APP_OIDC_CONFIG = '{ "authority": "http://106.120.107.150:5000", "client_id": "teamix-personal-center-web-pc", "client_secret": "123456", "redirect_uri": "http://localhost:8080/callback.html", "response_type": "id_token token", "scope": "openid workapps.client api.workapps.user","post_logout_redirect_uri":"http://localhost:8080", "silent_redirect_uri": "http://localhost:8080/silent-renew.html", "automaticSilentRenew": true,"accessTokenExpiringNotificationTime":60,"filterProtocolClaims":true,"loadUserInfo":true,"loadUserInfo":true }'
VUE_APP_BASE_URL= "http://organization.test.hrs100.cn:18080/"
VUE_APP_BASE_URL= http://organization.test.hrs100.cn:18080
VUE_APP_USERINFO_URL=http://106.120.107.145:7778/v1/qqxb/user/api
# https开关
VUE_APP_OPEN_HTTPS=false
VUE_APP_OIDC_CONFIG = '{ "authority": "https://passport.teammix.com", "client_id": "qqxb-activity-web-mobile", "client_secret": "qqxb#teammix#2019", "redirect_uri": "https://invite.activity.h5.hrs100.com/callback.html", "response_type": "id_token token", "scope": "workapps.client api.workapps.user api.workapps.org api.workapps.open openid","post_logout_redirect_uri":"https://invite.activity.h5.hrs100.com", "silent_redirect_uri": "https://invite.activity.h5.hrs100.com/silent-renew-oidc.html", "automaticSilentRenew": true,"accessTokenExpiringNotificationTime":60,"filterProtocolClaims":true,"loadUserInfo":true }'
#VUE_APP_API_BASEURL = 'https://apiplus.qinqinxiaobao.com/v1/qqxb/user/api'
VUE_APP_USERINFO_URL="";
VUE_APP_OIDC_CONFIG = '{ "authority": "http://106.120.107.150:5000", "client_id": "qqxb-activity-web-mobile", "client_secret": "123456", "redirect_uri": "http://106.120.107.150:7774/callback.html", "response_type": "id_token token", "scope": "workapps.client api.workapps.user api.workapps.org api.workapps.open openid","post_logout_redirect_uri":"http://106.120.107.150:7774", "silent_redirect_uri": "http://106.120.107.150:7774/silent-renew-oidc.html", "automaticSilentRenew": true,"automaticSilentSignin":true,"accessTokenExpiringNotificationTime":60,"filterProtocolClaims":true,"loadUserInfo":true }'
#VUE_APP_API_BASEURL = 'http://106.120.107.145:7778/v1/qqxb/user/api'
VUE_APP_BASE_URL= http://organization.test.hrs100.cn:18080
VUE_APP_USERINFO_URL=http://106.120.107.145:7778/v1/qqxb/user/api
......@@ -16,7 +16,7 @@ export default [
component: () => import("@/views/SelectIdentity.vue"),
meta: {
title: '身份选择',
requiresAuth: false
requiresAuth: true
}
},
{
......
......@@ -3,6 +3,7 @@ import store from '@/store';
import { EmployeeInterface } from '@/services/employee/employeeService';
import urls from '@/utils/urls';
/**
* 员工服务类
*/
......@@ -42,13 +43,8 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public async getUserInfo(params: any): Promise<any> {
console.log(this.header);
// let result = await request.get("http://qinqinxiaobao.com", "", this.header);
// console.log(result);
return {
id: 1,
name: "333"
}
const url = urls.userInfoUrl + `/userAuthDetails`;
return request.postWithAuthHeader(url, params, this.header)
}
/**
......@@ -56,7 +52,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getWorkInfoList(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/work`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/work`;
return request.get(url, params, this.header)
}
......@@ -66,7 +62,7 @@ class EmployeeService implements EmployeeInterface {
*/
public getWorkInfoDetail(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/work/detail`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/work/detail`;
return request.get(url, params, this.header)
}
......@@ -75,7 +71,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getPersonInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/info`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/info`;
return request.get(url, params, this.header)
}
......@@ -84,7 +80,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public savePersonInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/info`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/info`;
return request.post(url, params, this.header)
}
......@@ -93,7 +89,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getContactInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/contact/info`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/contact/info`;
return request.get(url, params, this.header)
}
......@@ -102,7 +98,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public saveContactInfo(params: any): Promise<any> {
let url = `/api/user/contact/${params.edId}/info`;
let url = urls.employeeUrl + `/api/user/contact/${params.edId}/info`;
return request.post(url, params, this.header)
}
......@@ -111,7 +107,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getSocialInfo(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/unit/relation`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/unit/relation`;
return request.get(url, params, this.header)
}
......@@ -120,7 +116,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public saveSocialInfo(params: any): Promise<any> {
let url = `/api/user/employee/unit/relation/save`;
let url = urls.employeeUrl + `/api/user/employee/unit/relation/save`;
return request.post(url, params, this.header)
}
......@@ -129,7 +125,7 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getWageCardInfo(params: any): Promise<any> {
let url = `/api/user/contact/${params.edId}/salary/card/info`;
let url = urls.employeeUrl + `/api/user/contact/${params.edId}/salary/card/info`;
return request.get(url, params, this.header)
}
......@@ -138,7 +134,7 @@ class EmployeeService implements EmployeeInterface {
* @params params
*/
public saveWageCardInfo(params: any): Promise<any> {
let url = `/api/user/contact/salary/card/info`;
let url = urls.employeeUrl + `/api/user/contact/salary/card/info`;
return request.post(url, params, this.header)
}
......@@ -147,17 +143,17 @@ class EmployeeService implements EmployeeInterface {
* @param params 请求参数
*/
public getEduExperience(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/education`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/education`;
return request.get(url, params, this.header)
}
/**
* 获取教育信息详细
* @param params
*/
public getEduExperienceDetial(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/education/detial`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/education/detial`;
return request.get(url, params, this.header)
}
......@@ -166,7 +162,7 @@ class EmployeeService implements EmployeeInterface {
* @param params
*/
public addEduExperience(params: any): Promise<any> {
let url = `/api/user/employee/edu/info`;
let url = urls.employeeUrl + `/api/user/employee/edu/info`;
return request.post(url, params, this.header)
}
......@@ -175,7 +171,7 @@ class EmployeeService implements EmployeeInterface {
* @param params
*/
public updateEduExperience(params: any): Promise<any> {
let url = `/api/user/employee/edu/info`;
let url = urls.employeeUrl + `/api/user/employee/edu/info`;
return request.put(url, params, this.header)
}
......@@ -184,7 +180,7 @@ class EmployeeService implements EmployeeInterface {
* @param params
*/
public getTechnologyExperience(params: any): Promise<any> {
let url = `/api/user/employee/${params.edId}/expertise/info`;
let url = urls.employeeUrl + `/api/user/employee/${params.edId}/expertise/info`;
return request.get(url, params, this.header)
}
......@@ -193,7 +189,7 @@ class EmployeeService implements EmployeeInterface {
* @param params
*/
public updateTechnologyExperience(params: any): Promise<any> {
let url = `/api/user/employee/expertise/info`;
let url = urls.employeeUrl + `/api/user/employee/expertise/info`;
return request.put(url, params, this.header)
}
......
......@@ -4,7 +4,6 @@ import { ResponseData } from '@/types/index';
let http: AxiosInstance | any;
http = axios.create({
baseURL: process.env.VUE_APP_BASE_URL,
timeout: 60000,
});
......
......@@ -37,6 +37,23 @@ class Request {
/**
*
* POST 请求
* @param url 请求链接
* @param params 请求参数
* @param headers 请求头信息
*/
public postWithAuthHeader(url: string, params: any = {}, headers: any = {}) {
let options: any = {};
if (headers) {
options.headers = headers;
}
return new Promise((resolve, reject) => {
resolve(http.post(`${url}?${GetCommonPms(true)}`, params, options));
})
}
/**
*
* PUT 请求
* @param url 请求链接
* @param params 请求参数
......
......@@ -3,500 +3,508 @@
* @param tel 手机号
*/
export function isTel(tel: string) {
return /^1\d{10}$/.test(tel);
}
/**
* 验证邮箱
* @param email 邮箱
*/
export function isEmail(email: string) {
return /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email);
}
/**
* 验证密码格式(8-16位,数字和英文字母的组合)
* @param password 密码
*/
export function isPassWord(password: string) {
// console.log(password);
return /^(?=.*?[0-9])(?=.*?[A-Za-z])[0-9A-Za-z]{8,16}$/.test(password);
}
/**
* 验证银行卡号
* @param banknum 银行卡号
*/
export function isBankNum(banknum: string) {
return /^([1-9]{1})(\d{15}|\d{18})$/.test(banknum);
}
/**
* 验证身份证号
* @param id 身份证号
*/
export function isIdCard(id: string) {
return /^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$/.test(id);
}
/**
* 模糊手机号
* @param mobile 手机号
*/
export function fuzzyMobile(mobile: string) {
let mobileFront = mobile.slice(0, 3);
let mobileEnd = mobile.slice(7);
return mobileFront + '****' + mobileEnd;
}
/**
* 模糊邮箱
* @param email 邮箱
*/
export function fuzzyEmail(email: string) {
let emailFront = email.slice(0, 1);
let index = email.indexOf('@');
let emailEnd = email.slice(index);
return emailFront + '****' + emailEnd;
}
/**
* 姓名格式化为‘'*' + 尾字’
* @param name 姓名
*/
export function fuzzyName(name: string) {
// console.log(name);
return '*' + name.slice(-1);
}
/**
* 身份证号格式化为‘首1+'******'+尾1’
* @param idnum 身份证
*/
export function fuzzyIdNum(idnum: string) {
if (idnum === "") {
return "";
}
return (idnum || "").slice(0, 1) + '****************' + (idnum || "").slice(-1);
return /^1\d{10}$/.test(tel);
}
/**
* 验证邮箱
* @param email 邮箱
*/
export function isEmail(email: string) {
return /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/.test(email);
}
/**
* 验证密码格式(8-16位,数字和英文字母的组合)
* @param password 密码
*/
export function isPassWord(password: string) {
// console.log(password);
return /^(?=.*?[0-9])(?=.*?[A-Za-z])[0-9A-Za-z]{8,16}$/.test(password);
}
/**
* 验证银行卡号
* @param banknum 银行卡号
*/
export function isBankNum(banknum: string) {
return /^([1-9]{1})(\d{15}|\d{18})$/.test(banknum);
}
/**
* 验证身份证号
* @param id 身份证号
*/
export function isIdCard(id: string) {
return /^\d{6}(18|19|20)\d{2}(0\d|10|11|12)([0-2]\d|30|31)\d{3}(\d|X|x)$/.test(id);
}
/**
* 模糊手机号
* @param mobile 手机号
*/
export function fuzzyMobile(mobile: string) {
let mobileFront = mobile.slice(0, 3);
let mobileEnd = mobile.slice(7);
return mobileFront + '****' + mobileEnd;
}
/**
* 模糊邮箱
* @param email 邮箱
*/
export function fuzzyEmail(email: string) {
let emailFront = email.slice(0, 1);
let index = email.indexOf('@');
let emailEnd = email.slice(index);
return emailFront + '****' + emailEnd;
}
/**
* 姓名格式化为‘'*' + 尾字’
* @param name 姓名
*/
export function fuzzyName(name: string) {
// console.log(name);
return '*' + name.slice(-1);
}
/**
* 身份证号格式化为‘首1+'******'+尾1’
* @param idnum 身份证
*/
export function fuzzyIdNum(idnum: string) {
if (idnum === "") {
return "";
}
/**
* 银行卡号格式化为‘首4+'******'+尾4’
* @param banknunm 银行卡号
*/
export function fuzzyBankNum(banknunm: string) {
if (banknunm === "") {
return "";
}
return (banknunm || "").slice(0, 4) + '********' + (banknunm || "").slice(-4);
return (idnum || "").slice(0, 1) + '****************' + (idnum || "").slice(-1);
}
/**
* 银行卡号格式化为‘首4+'******'+尾4’
* @param banknunm 银行卡号
*/
export function fuzzyBankNum(banknunm: string) {
if (banknunm === "") {
return "";
}
/**
* 获取性别
* @param sex 性别数字
*/
export function gender(sex: number) {
let genderArr = ['', '男', '女'];
if (sex > 0) {
return genderArr[sex];
} else {
return '';
}
return (banknunm || "").slice(0, 4) + '********' + (banknunm || "").slice(-4);
}
/**
* 获取性别
* @param sex 性别数字
*/
export function gender(sex: number) {
let genderArr = ['', '男', '女'];
if (sex > 0) {
return genderArr[sex];
} else {
return '';
}
/**
* 获取认证方式
* @param value 认证关键字
*/
export function authMethod(value: string) {
let bankArray: { [key: string]: string } = {
"MANUAL": "手动认证",
"TWO": "二要素认证",
"BANK_FOUR": "四要素认证",
"MOBILE_THREE": "三要素认证"
};
for (let k in bankArray) {
if (k === value) {
return bankArray[k];
}
}
/**
* 获取认证方式
* @param value 认证关键字
*/
export function authMethod(value: string) {
let bankArray: { [key: string]: string } = {
"MANUAL": "手动认证",
"TWO": "二要素认证",
"BANK_FOUR": "四要素认证",
"MOBILE_THREE": "三要素认证"
};
for (let k in bankArray) {
if (k === value) {
return bankArray[k];
}
return "";
}
/**
* 检测字符串是否为空
* @param value 字符串
*/
export function isNullOrEmpty(value: string) {
if (value === null || value === undefined || value === "") {
return false;
}
return true;
return "";
}
/**
* 检测字符串是否为空
* @param value 字符串
*/
export function isNullOrEmpty(value: string) {
if (value === null || value === undefined || value === "") {
return false;
}
/**
* 节流调用
* @param this 当前调用对象
* @param fn 是我们需要包装的事件回调
* @param delay 是时间间隔的阈值
*/
export function throttle(this: any, fn: Function, delay: number) {
// last为上一次触发回调的时间, timer是定时器
let last = 0, timer: any = null;
// 将throttle处理结果当作函数返回
return () => {
// 保留调用时的this上下文
let context = this;
// 保留调用时传入的参数
let args = this.arguments;
// 记录本次触发回调的时间
let now = +new Date();
// 判断上次触发的时间和本次触发的时间差是否小于时间间隔的阈值
if (now - last < delay) {
// 如果时间间隔小于我们设定的时间间隔阈值,则为本次触发操作设立一个新的定时器
clearTimeout(timer);
timer = setTimeout(function () {
last = now;
fn.apply(context, args);
}, delay);
} else {
// 如果时间间隔超出了我们设定的时间间隔阈值,那就不等了,无论如何要反馈给用户一次响应
return true;
}
/**
* 节流调用
* @param this 当前调用对象
* @param fn 是我们需要包装的事件回调
* @param delay 是时间间隔的阈值
*/
export function throttle(this: any, fn: Function, delay: number) {
// last为上一次触发回调的时间, timer是定时器
let last = 0, timer: any = null;
// 将throttle处理结果当作函数返回
return () => {
// 保留调用时的this上下文
let context = this;
// 保留调用时传入的参数
let args = this.arguments;
// 记录本次触发回调的时间
let now = +new Date();
// 判断上次触发的时间和本次触发的时间差是否小于时间间隔的阈值
if (now - last < delay) {
// 如果时间间隔小于我们设定的时间间隔阈值,则为本次触发操作设立一个新的定时器
clearTimeout(timer);
timer = setTimeout(function () {
last = now;
fn.apply(context, args);
}
};
}
/**
* 字符串转16进制
* @param s 字符串
*/
function bin2hex(s: string) {
var i,
l,
o = "",
n;
s += "";
for (i = 0, l = s.length; i < l; i++) {
n = s.charCodeAt(i).toString(16)
o += n.length < 2 ? "0" + n : n;
}, delay);
} else {
// 如果时间间隔超出了我们设定的时间间隔阈值,那就不等了,无论如何要反馈给用户一次响应
last = now;
fn.apply(context, args);
}
return o;
}
/**
* 获取画布
*/
function getCanvas() {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
ctx!.fillStyle = "#f60";
ctx!.fillRect(125, 1, 62, 20);
var b64 = canvas.toDataURL().replace("data:image/png;base64,", "");
var bin = atob(b64);
var crc = bin2hex(bin.slice(-16, -12));
return crc;
};
}
/**
* 字符串转16进制
* @param s 字符串
*/
function bin2hex(s: string) {
var i,
l,
o = "",
n;
s += "";
for (i = 0, l = s.length; i < l; i++) {
n = s.charCodeAt(i).toString(16)
o += n.length < 2 ? "0" + n : n;
}
/**
* 获取系统信息
*/
function getOsInfo() {
var userAgent = navigator.userAgent.toLowerCase();
var name = "Unknown";
var version = "Unknown";
if (userAgent.indexOf("win") > -1) {
name = "Windows";
if (userAgent.indexOf("windows nt 5.0") > -1) {
version = "Windows 2000";
} else if (
userAgent.indexOf("windows nt 5.1") > -1 ||
userAgent.indexOf("windows nt 5.2") > -1
) {
version = "Windows XP";
} else if (userAgent.indexOf("windows nt 6.0") > -1) {
version = "Windows Vista";
} else if (
userAgent.indexOf("windows nt 6.1") > -1 ||
userAgent.indexOf("windows 7") > -1
) {
version = "Windows 7";
} else if (
userAgent.indexOf("windows nt 6.2") > -1 ||
userAgent.indexOf("windows 8") > -1
) {
version = "Windows 8";
} else if (userAgent.indexOf("windows nt 6.3") > -1) {
version = "Windows 8.1";
} else if (
userAgent.indexOf("windows nt 6.2") > -1 ||
userAgent.indexOf("windows nt 10.0") > -1
) {
version = "Windows 10";
} else {
version = "Unknown";
}
} else if (userAgent.indexOf("iphone") > -1) {
name = "Iphone";
} else if (userAgent.indexOf("mac") > -1) {
name = "Mac";
return o;
}
/**
* 获取画布
*/
function getCanvas() {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
ctx!.fillStyle = "#f60";
ctx!.fillRect(125, 1, 62, 20);
var b64 = canvas.toDataURL().replace("data:image/png;base64,", "");
var bin = atob(b64);
var crc = bin2hex(bin.slice(-16, -12));
return crc;
}
/**
* 获取系统信息
*/
function getOsInfo() {
var userAgent = navigator.userAgent.toLowerCase();
var name = "Unknown";
var version = "Unknown";
if (userAgent.indexOf("win") > -1) {
name = "Windows";
if (userAgent.indexOf("windows nt 5.0") > -1) {
version = "Windows 2000";
} else if (
userAgent.indexOf("windows nt 5.1") > -1 ||
userAgent.indexOf("windows nt 5.2") > -1
) {
version = "Windows XP";
} else if (userAgent.indexOf("windows nt 6.0") > -1) {
version = "Windows Vista";
} else if (
userAgent.indexOf("windows nt 6.1") > -1 ||
userAgent.indexOf("windows 7") > -1
) {
version = "Windows 7";
} else if (
userAgent.indexOf("x11") > -1 ||
userAgent.indexOf("unix") > -1 ||
userAgent.indexOf("sunname") > -1 ||
userAgent.indexOf("bsd") > -1
userAgent.indexOf("windows nt 6.2") > -1 ||
userAgent.indexOf("windows 8") > -1
) {
name = "Unix";
} else if (userAgent.indexOf("linux") > -1) {
if (userAgent.indexOf("android") > -1) {
name = "Android"
} else {
name = "Linux";
}
version = "Windows 8";
} else if (userAgent.indexOf("windows nt 6.3") > -1) {
version = "Windows 8.1";
} else if (
userAgent.indexOf("windows nt 6.2") > -1 ||
userAgent.indexOf("windows nt 10.0") > -1
) {
version = "Windows 10";
} else {
version = "Unknown";
}
} else if (userAgent.indexOf("iphone") > -1) {
name = "Iphone";
} else if (userAgent.indexOf("mac") > -1) {
name = "Mac";
} else if (
userAgent.indexOf("x11") > -1 ||
userAgent.indexOf("unix") > -1 ||
userAgent.indexOf("sunname") > -1 ||
userAgent.indexOf("bsd") > -1
) {
name = "Unix";
} else if (userAgent.indexOf("linux") > -1) {
if (userAgent.indexOf("android") > -1) {
name = "Android"
} else {
name = "Unknown";
name = "Linux";
}
// var os = new Object();
// os.name = name;
// os.version = version;
return version;
//document.write("系统:" + os.name + "版本:" + os.name)
} else {
name = "Unknown";
}
/**
* 获取浏览器信息
*/
function getBrowerInfo() {
var Browser: any =
Browser ||
(function (window) {
var document = window.document,
navigator = window.navigator,
agent = navigator.userAgent.toLowerCase(),
//IE8+支持.返回浏览器渲染当前文档所用的模式
//IE6,IE7:undefined.IE8:8(兼容模式返回7).IE9:9(兼容模式返回7||8)
//IE10:10(兼容模式7||8||9)
IEMode = (<any>document).documentMode,
//chorme
chrome = (<any>window).chrome || false,
System = {
//user-agent
agent: agent,
//是否为IE
isIE: /trident/.test(agent),
//Gecko内核
isGecko: agent.indexOf("gecko") > 0 && agent.indexOf("like gecko") < 0,
//webkit内核
isWebkit: agent.indexOf("webkit") > 0,
//是否为标准模式
isStrict: document.compatMode === "CSS1Compat",
//是否支持subtitle
supportSubTitle: function () {
return "track" in document.createElement("track");
},
//是否支持scoped
supportScope: function () {
return "scoped" in document.createElement("style");
},
//获取IE的版本号
ieVersion: function () {
var rMsie = /(msie\s|trident.*rv:)([\w.]+)/;
var ma = window.navigator.userAgent.toLowerCase()
var match = rMsie.exec(ma);
try {
return match![2];
} catch (e) {
return IEMode;
}
},
//Opera版本号
operaVersion: function () {
try {
if ((<any>window).opera) {
return agent.match(/opera.([\d.]+)/)![1];
} else if (agent.indexOf("opr") > 0) {
return agent.match(/opr\/([\d.]+)/)![1];
}
} catch (e) {
return 0;
}
}
};
try {
//浏览器类型(IE、Opera、Chrome、Safari、Firefox)
(<any>System).type = System.isIE
? "IE"
: (<any>window).opera || agent.indexOf("opr") > 0
? "Opera"
: agent.indexOf("chrome") > 0
? "Chrome"
: //safari也提供了专门的判定方式
(<any>window).openDatabase
? "Safari"
: agent.indexOf("firefox") > 0
? "Firefox"
: "unknow";
//版本号
(<any>System).version = ((<any>System).type === "IE") ? System.ieVersion() :
((<any>System).type === "Firefox") ? agent.match(/firefox\/([\d.]+)/)![1] :
((<any>System).type === "Chrome") ? agent.match(/chrome\/([\d.]+)/)![1] :
((<any>System).type === "Opera") ? System.operaVersion() :
((<any>System).type === "Safari") ? agent.match(/version\/([\d.]+)/)![1] :
"0";
//浏览器外壳
(<any>System).shell = function () {
if (agent.indexOf("edge") > 0) {
(<any>System).version = agent.match(/edge\/([\d.]+)/)![1] || (<any>System).version;
return "edge浏览器";
// var os = new Object();
// os.name = name;
// os.version = version;
return version;
//document.write("系统:" + os.name + "版本:" + os.name)
}
/**
* 获取浏览器信息
*/
function getBrowerInfo() {
var Browser: any =
Browser ||
(function (window) {
var document = window.document,
navigator = window.navigator,
agent = navigator.userAgent.toLowerCase(),
//IE8+支持.返回浏览器渲染当前文档所用的模式
//IE6,IE7:undefined.IE8:8(兼容模式返回7).IE9:9(兼容模式返回7||8)
//IE10:10(兼容模式7||8||9)
IEMode = (<any>document).documentMode,
//chorme
chrome = (<any>window).chrome || false,
System = {
//user-agent
agent: agent,
//是否为IE
isIE: /trident/.test(agent),
//Gecko内核
isGecko: agent.indexOf("gecko") > 0 && agent.indexOf("like gecko") < 0,
//webkit内核
isWebkit: agent.indexOf("webkit") > 0,
//是否为标准模式
isStrict: document.compatMode === "CSS1Compat",
//是否支持subtitle
supportSubTitle: function () {
return "track" in document.createElement("track");
},
//是否支持scoped
supportScope: function () {
return "scoped" in document.createElement("style");
},
//获取IE的版本号
ieVersion: function () {
var rMsie = /(msie\s|trident.*rv:)([\w.]+)/;
var ma = window.navigator.userAgent.toLowerCase()
var match = rMsie.exec(ma);
try {
return match![2];
} catch (e) {
return IEMode;
}
//遨游浏览器
if (agent.indexOf("maxthon") > 0) {
(<any>System).version = agent.match(/maxthon\/([\d.]+)/)![1] || (<any>System).version;
return "傲游浏览器";
},
//Opera版本号
operaVersion: function () {
try {
if ((<any>window).opera) {
return agent.match(/opera.([\d.]+)/)![1];
} else if (agent.indexOf("opr") > 0) {
return agent.match(/opr\/([\d.]+)/)![1];
}
} catch (e) {
return 0;
}
//QQ浏览器
if (agent.indexOf("qqbrowser") > 0) {
(<any>System).version = agent.match(/qqbrowser\/([\d.]+)/)![1] || (<any>System).version;
return "QQ浏览器";
}
};
try {
//浏览器类型(IE、Opera、Chrome、Safari、Firefox)
(<any>System).type = System.isIE
? "IE"
: (<any>window).opera || agent.indexOf("opr") > 0
? "Opera"
: agent.indexOf("chrome") > 0
? "Chrome"
: //safari也提供了专门的判定方式
(<any>window).openDatabase
? "Safari"
: agent.indexOf("firefox") > 0
? "Firefox"
: "unknow";
//版本号
(<any>System).version = ((<any>System).type === "IE") ? System.ieVersion() :
((<any>System).type === "Firefox") ? agent.match(/firefox\/([\d.]+)/)![1] :
((<any>System).type === "Chrome") ? agent.match(/chrome\/([\d.]+)/)![1] :
((<any>System).type === "Opera") ? System.operaVersion() :
((<any>System).type === "Safari") ? agent.match(/version\/([\d.]+)/)![1] :
"0";
//浏览器外壳
(<any>System).shell = function () {
if (agent.indexOf("edge") > 0) {
(<any>System).version = agent.match(/edge\/([\d.]+)/)![1] || (<any>System).version;
return "edge浏览器";
}
//遨游浏览器
if (agent.indexOf("maxthon") > 0) {
(<any>System).version = agent.match(/maxthon\/([\d.]+)/)![1] || (<any>System).version;
return "傲游浏览器";
}
//QQ浏览器
if (agent.indexOf("qqbrowser") > 0) {
(<any>System).version = agent.match(/qqbrowser\/([\d.]+)/)![1] || (<any>System).version;
return "QQ浏览器";
}
//搜狗浏览器
if (agent.indexOf("se 2.x") > 0) {
return '搜狗浏览器';
}
//Chrome:也可以使用window.chrome && window.chrome.webstore判断
if (chrome && (<any>System).type !== "Opera") {
var external = window.external,
clientInfo = window.clientInformation,
//客户端语言:zh-cn,zh.360下面会返回undefined
clientLanguage = clientInfo.languages;
//猎豹浏览器:或者agent.indexOf("lbbrowser")>0
if (external && 'LiebaoGetVersion' in external) {
return '猎豹浏览器';
}
//搜狗浏览器
if (agent.indexOf("se 2.x") > 0) {
return '搜狗浏览器';
//百度浏览器
if (agent.indexOf("bidubrowser") > 0) {
(<any>System).version = agent.match(/bidubrowser\/([\d.]+)/)![1] ||
agent.match(/chrome\/([\d.]+)/)![1];
return "百度浏览器";
}
//Chrome:也可以使用window.chrome && window.chrome.webstore判断
if (chrome && (<any>System).type !== "Opera") {
var external = window.external,
clientInfo = window.clientInformation,
//客户端语言:zh-cn,zh.360下面会返回undefined
clientLanguage = clientInfo.languages;
//猎豹浏览器:或者agent.indexOf("lbbrowser")>0
if (external && 'LiebaoGetVersion' in external) {
return '猎豹浏览器';
}
//百度浏览器
if (agent.indexOf("bidubrowser") > 0) {
(<any>System).version = agent.match(/bidubrowser\/([\d.]+)/)![1] ||
agent.match(/chrome\/([\d.]+)/)![1];
return "百度浏览器";
}
//360极速浏览器和360安全浏览器
if (System.supportSubTitle() && typeof clientLanguage === "undefined") {
//object.key()返回一个数组.包含可枚举属性和方法名称
var storeKeyLen = Object.keys(chrome.webstore).length,
v8Locale = "v8Locale" in window;
return storeKeyLen > 1 ? '360极速浏览器' : '360安全浏览器';
}
return "Chrome";
//360极速浏览器和360安全浏览器
if (System.supportSubTitle() && typeof clientLanguage === "undefined") {
//object.key()返回一个数组.包含可枚举属性和方法名称
var storeKeyLen = Object.keys(chrome.webstore).length,
v8Locale = "v8Locale" in window;
return storeKeyLen > 1 ? '360极速浏览器' : '360安全浏览器';
}
return (<any>System).type;
};
//浏览器名称(如果是壳浏览器,则返回壳名称)
(<any>System).name = (<any>System).shell();
//对版本号进行过滤过处理
// System.version = System.versionFilter(System.version);
} catch (e) { }
return {
client: System
return "Chrome";
}
return (<any>System).type;
};
})(window);
if (Browser.client.name == undefined || Browser.client.name == "") {
Browser.client.name = "Unknown";
Browser.client.version = "Unknown";
} else if (Browser.client.version == undefined) {
Browser.client.version = "Unknown";
}
// document.write(Browser.client.name + " " + Browser.client.version);
return Browser;
//浏览器名称(如果是壳浏览器,则返回壳名称)
(<any>System).name = (<any>System).shell();
//对版本号进行过滤过处理
// System.version = System.versionFilter(System.version);
} catch (e) { }
return {
client: System
};
})(window);
if (Browser.client.name == undefined || Browser.client.name == "") {
Browser.client.name = "Unknown";
Browser.client.version = "Unknown";
} else if (Browser.client.version == undefined) {
Browser.client.version = "Unknown";
}
/**
* 获取公共参数
*/
export function GetCommonPms() {
const v = "1.0.1";
const did = getCanvas();
const dh = getOsInfo();
const BrowerInfo = getBrowerInfo();
const db = BrowerInfo.client.name;
const dv = BrowerInfo.client.version;
// document.write(Browser.client.name + " " + Browser.client.version);
return Browser;
}
/**
* 获取公共参数
*/
export function GetCommonPms(special: boolean = false) {
const v = "1.0.1";
const did = getCanvas();
const dh = getOsInfo();
const BrowerInfo = getBrowerInfo();
const db = BrowerInfo.client.name;
const dv = BrowerInfo.client.version;
if (!special) {
const t = new Date().getTime();
const pms = `v=${v}&&did=${did}&&dh=${dh}&&db=${db}&&dv=${dv}&&dm=&&lat=&&lng=&&t=${t}`;
return pms;
} else {
const pms = `v=${v}&&did=${did}&&dh=${dh}&&db=${db}&&dv=${dv}&&dm=&&lat=&&lng=&&t=`;
return pms;
}
/**
* 判断是否是移动端
*/
export function isMobileBrowser() {
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
return true;
}
return false;
}
/**
* 判断是否是移动端
*/
export function isMobileBrowser() {
if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
return true;
}
function padLeftZero(str: string) {
return ('00' + str).substr(str.length)
return false;
}
function padLeftZero(str: string) {
return ('00' + str).substr(str.length)
}
/**
* 时间转换成字符串
* @param date 时间
* @param fmt 转换格式
*/
export function formatDate(date: Date, fmt = 'yyyy-MM-dd hh:mm:ss') {
if (!date) {
return "";
}
/**
* 时间转换成字符串
* @param date 时间
* @param fmt 转换格式
*/
export function formatDate(date: Date, fmt = 'yyyy-MM-dd hh:mm:ss') {
if (!date) {
return "";
}
if (typeof date === 'string') {
date = new Date(date);
}
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
let o: any = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
let str = o[k] + '';
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
}
}
return fmt;
if (typeof date === 'string') {
date = new Date(date);
}
/**
* 获取当前所在系统
*/
export function CheckPlatform() {
if (/Win/i.test(navigator.platform)) {
return "PC-WINDOWS";
} else if (/Mac/i.test(navigator.platform)) {
return "PC-MAC";
} else if (/android/.test(navigator.userAgent)) {
return "ANDROID";
} else if (/Linux/i.test(navigator.platform)) {
return "ANDROID";
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.platform)) {
return "IOS";
} else {
return "";
if (/(y+)/.test(fmt)) {
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
}
let o: any = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds()
}
for (let k in o) {
let str = o[k] + '';
if (new RegExp(`(${k})`).test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
}
}
\ No newline at end of file
}
return fmt;
}
/**
* 获取当前所在系统
*/
export function CheckPlatform() {
if (/Win/i.test(navigator.platform)) {
return "PC-WINDOWS";
} else if (/Mac/i.test(navigator.platform)) {
return "PC-MAC";
} else if (/android/.test(navigator.userAgent)) {
return "ANDROID";
} else if (/Linux/i.test(navigator.platform)) {
return "ANDROID";
} else if (/(iPhone|iPad|iPod|iOS)/i.test(navigator.platform)) {
return "IOS";
} else {
return "";
}
}
\ No newline at end of file
......@@ -8,10 +8,10 @@ class Urls {
*/
employeeUrl: String = process.env.VUE_APP_BASE_URL;
// /**
// * 认证中心
// */
// tokenUrl: String = process.env.VUE_APP_LOGIN_URL;
/**
* 获取用户信息
*/
userInfoUrl: String = process.env.VUE_APP_USERINFO_URL;
}
......
......@@ -27,14 +27,28 @@
<script lang='ts'>
import { Component, Vue } from "vue-property-decorator";
@Component
@Component({
components: {}
})
export default class SelectIdentity extends Vue {
private id_no: string = "";
private toFlex(): void {
this.$router.push({ name: "FlexEmployee" });
this.$router.push({ name: "FlexEmployee", query: { id_no: this.id_no } });
}
private toIndex(): void {
this.$router.push({ name: "Index" });
this.$router.push({ name: "Index", query: { id_no: this.id_no } });
}
created() {
this.$server.EmployeeService.getUserInfo({}).then(res => {
if (res.data && res.data.uthStatus && res.data.uthStatus > 2) {
this.id_no = res.data.personalIdCardNo;
} else {
//TODO: 跳转到实名认证
}
});
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment