diff --git a/src/api/user.js b/src/api/user.js index aa9354c5..d1417821 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -157,3 +157,12 @@ export function getUserLogList(params) { data: params }) } + +// 获取登录用户 +export function getTrialUserList(params) { + return request({ + url: `/TrialMaintenance/getTrialUserList`, + method: 'get', + params + }) +} diff --git a/src/main.js b/src/main.js index 29ba2ca3..a70c2d40 100644 --- a/src/main.js +++ b/src/main.js @@ -63,8 +63,8 @@ Vue.use(adaptive) import dialogDrag from '@/directive/dialogDrag' // 窗口拖拽 Vue.use(dialogDrag) -if(!String.prototype.replaceAll){ - String.prototype.replaceAll = function(str, newStr){ +if (!String.prototype.replaceAll) { + String.prototype.replaceAll = function (str, newStr) { // 正则表达式 if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') { return this.replace(str, newStr) @@ -96,12 +96,24 @@ Vue.prototype.selectDictLabel = selectDictLabel // Vue.prototype.download = download Vue.prototype.handleTree = handleTree Vue.prototype.$getObjectName = (url) => { + // console.log(Vue.prototype.) // console.log(url) var value = url - var str = value.split("//"); //https://进行分割, - var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引, - // console.log(str[1].substring(index)); //substring 截取, - return '/' + str[1].substring(index) + // var str = value.split("//"); //https://进行分割, + // var index = str[1].indexOf("/")+1; //indexOf 获取第一个斜杠的索引, + // // console.log(str[1].substring(index)); //substring 截取, + // return '/' + str[1].substring(index) + let basePath = Vue.prototype.OSSclientConfig.viewEndpoint; + let basePathHttp = Vue.prototype.OSSclientConfig.viewEndpoint.replace("https", 'http') + let arr = value.split(basePath); + let name = null; + if (arr.length > 1) { + name = arr[1]; + } else { + name = value.split(basePathHttp)[1]; + } + // console.log(name) + return name; } Vue.prototype.getGuid = (text) => { text = md5(text) @@ -117,14 +129,14 @@ Vue.prototype.getGuid = (text) => { t9 = text.substr(16, 4) t10 = text.substr(20, 12) // console.log(`${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}`) - return `${t4+t3+t2+t1}-${t6+t5}-${t8+t7}-${t9}-${t10}` + return `${t4 + t3 + t2 + t1}-${t6 + t5}-${t8 + t7}-${t9}-${t10}` } Vue.prototype.$validatePassword = (rule, value, callback) => { - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' /* eslint-disable */ var reg1 = eval(process.env.VUE_APP_PASSWORD_FOR_PERMISSION) ? new RegExp(`${process.env.VUE_APP_PASSWORD_FOR_REGULAR}`) : /.*/g; //密码必须是8位以上、必须含有字母、数字、特殊符号 if (!reg1.test(value)) { - callback(lang==='zh' ? new Error("密码必须包含:1)8 – 32 个字符;2)至少1个数字;3) 至少1个大写字母;4)至少1个小写字母;5)至少1个特殊字符 (~!-@#$%^&*_+?)") : new Error('Passwords must have: 1) 8 - 32 characters; 2) At least 1 number; 3) At least 1 uppercase letter; 4) At least 1 lowercase letter; 5) At least 1 special character (~!-@#$%^&*_+?) ')) + callback(lang === 'zh' ? new Error("密码必须包含:1)8 – 32 个字符;2)至少1个数字;3) 至少1个大写字母;4)至少1个小写字母;5)至少1个特殊字符 (~!-@#$%^&*_+?)") : new Error('Passwords must have: 1) 8 - 32 characters; 2) At least 1 number; 3) At least 1 uppercase letter; 4) At least 1 lowercase letter; 5) At least 1 special character (~!-@#$%^&*_+?) ')) } else { callback(); } @@ -158,7 +170,7 @@ Vue.prototype.fileToBlob = (file) => { } var _vm -async function VueInit () { +async function VueInit() { var params var res if (~window.location.href.indexOf('/readingDicoms') || ~window.location.href.indexOf('/noneDicomReading') || ~window.location.href.indexOf('/criterionquestions') || ~window.location.href.indexOf('/petct')) { @@ -187,14 +199,14 @@ async function VueInit () { }) let d = function (code) { var dictInfo = res.Result - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' try { for (var code in dictInfo) { - var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { + var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { return { id: dict.Id, - label: lang==='zh' ? dict.ValueCN : dict.Value, - value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code): dict.Code, + label: lang === 'zh' ? dict.ValueCN : dict.Value, + value: dict.DataTypeEnum === 3 ? eval(dict.Code) : dict.IsEnumInt ? parseInt(dict.Code) : dict.Code, raw: Object.assign({}, dict), IsBaseLineUse: false, IsFollowVisitUse: false @@ -202,7 +214,7 @@ async function VueInit () { }) : [] dictInfo[code] = dictList } - } catch (e){ + } catch (e) { console.error(e) } return dictInfo @@ -220,17 +232,17 @@ async function VueInit () { } catch (e) { } } - Vue.prototype.$updateDictionary = function() { + Vue.prototype.$updateDictionary = function () { Vue.prototype.$d = function (code) { var dictInfo = res.Result - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' try { for (var code in dictInfo) { - var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { + var dictList = (dictInfo[code] && dictInfo[code].length > 0) ? dictInfo[code].map(dict => { return { id: dict.raw.Id, - label: lang==='zh' ? dict.raw.ValueCN : dict.raw.Value, - value: dict.raw.DataTypeEnum === 3 ? eval(dict.raw.Code) : dict.raw.IsEnumInt ? parseInt(dict.raw.Code): dict.raw.Code, + label: lang === 'zh' ? dict.raw.ValueCN : dict.raw.Value, + value: dict.raw.DataTypeEnum === 3 ? eval(dict.raw.Code) : dict.raw.IsEnumInt ? parseInt(dict.raw.Code) : dict.raw.Code, raw: Object.assign({}, dict.raw), IsBaseLineUse: false, IsFollowVisitUse: false @@ -238,7 +250,7 @@ async function VueInit () { }) : [] _vm.$set(dictInfo, code, dictList) } - } catch (e){ + } catch (e) { console.error(e) } return dictInfo @@ -274,14 +286,14 @@ async function VueInit () { let count = 0; if (eval(process.env.VUE_APP_LOGIN_FOR_PERMISSION)) { setInterval(() => { - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' - if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' + if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { return } if (_vm.$store.state.user.userId !== zzSessionStorage.getItem('userId')) { window.location.href = `/login` zzSessionStorage.removeItem('lastWorkbench') - _vm.$alert(lang === 'en'? 'The same browser only allows one user account to be logged in at a time.' : '同一浏览器只允许同时登陆一个账户', { + _vm.$alert(lang === 'en' ? 'The same browser only allows one user account to be logged in at a time.' : '同一浏览器只允许同时登陆一个账户', { type: 'warning', }) } @@ -295,10 +307,10 @@ async function VueInit () { function countTime() { count++ localStorage.setItem('count', count) - if (count == parseInt(second2) || isLock === 'true') { + if (count == parseInt(second2) || isLock === 'true') { callback2(); } - if (count >= second) { + if (count >= second) { callback(); count = 0; localStorage.removeItem('count') @@ -334,23 +346,23 @@ async function VueInit () { /* eslint-disable */ window.VUE_APP_COMPANY_NAME = process.env.VUE_APP_COMPANY_NAME; waitOperate(eval(process.env.VUE_APP_LOGOUT_FOR_PERMISSION) ? () => { - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' - if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { - count = 0; - localStorage.setItem('count', '0') - return - } - _vm.$store.dispatch('user/logout').then(res => { - window.location.href = `/login` - }) + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' + if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { + count = 0; + localStorage.setItem('count', '0') + return + } + _vm.$store.dispatch('user/logout').then(res => { + window.location.href = `/login` + }) - _vm.$alert(lang === 'zh' ? '由于您长时间未操作,为保护您的数据安全已强制将您下线,如果需要继续操作请重新登陆!' : 'No operation for a long time non-operation, you have been forced logout to protect data security. If continue to operate, please login again!', { - type: 'warning', - }) - } : () => {}, process.env.VUE_APP_LOGOUT_FOR_TIME, + _vm.$alert(lang === 'zh' ? '由于您长时间未操作,为保护您的数据安全已强制将您下线,如果需要继续操作请重新登陆!' : 'No operation for a long time non-operation, you have been forced logout to protect data security. If continue to operate, please login again!', { + type: 'warning', + }) + } : () => { }, process.env.VUE_APP_LOGOUT_FOR_TIME, eval(process.env.VUE_APP_LOCK_FOR_PERMISSION) ? () => { - var lang = zzSessionStorage.getItem('lang')?zzSessionStorage.getItem('lang'):'zh' - if ( _vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { + var lang = zzSessionStorage.getItem('lang') ? zzSessionStorage.getItem('lang') : 'zh' + if (_vm.$route.path === '/ReviewersResearchForm' || _vm.$route.path === '/ReviewersResearch' || _vm.$route.path === '/login' || _vm.$route.path === '/researchForm' || _vm.$route.path === '/researchLogin' || _vm.$route.path === '/email-recompose' || _vm.$route.path === '/recompose' || _vm.$route.path === '/resetpassword' || _vm.$route.path === '/error') { count = 0; localStorage.setItem('count', '0') if (_vm.$route.path === '/login') { @@ -405,14 +417,14 @@ async function VueInit () { } } }, - message: h('div', {} , [ + message: h('div', {}, [ h('el-form', { props: { labelWidth: "80px" } }, [ h('el-form-item', { - props: {label: lang === 'zh' ? '用户名' : 'Username'}, + props: { label: lang === 'zh' ? '用户名' : 'Username' }, }, [ - h('input',{ + h('input', { props: { value: _vm.unlock.my_username }, @@ -432,7 +444,7 @@ async function VueInit () { }) ]), h('el-form-item', { - props: {label: lang === 'zh' ? '密码' : 'Password'}, + props: { label: lang === 'zh' ? '密码' : 'Password' }, }, [ h('input', { props: { @@ -457,7 +469,7 @@ async function VueInit () { ]) ]) }) - } : () => {}, process.env.VUE_APP_LOCK_FOR_TIME) + } : () => { }, process.env.VUE_APP_LOCK_FOR_TIME) } VueInit() diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 4055495a..3fc0a4eb 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -181,12 +181,12 @@ const actions = { // user logout async logout({ commit, state }) { try{ - await loginOut() removeToken() // must remove token first resetRouter() removeName() zzSessionStorage.clear() commit('RESET_STATE') + await loginOut() }catch(e){ console.log(e) } diff --git a/src/utils/oss.js b/src/utils/oss.js index af203207..6e780853 100644 --- a/src/utils/oss.js +++ b/src/utils/oss.js @@ -21,6 +21,7 @@ async function ossGenerateSTS() { let res = await GetObjectStoreToken() Vue.prototype.OSSclientConfig = { ...res.Result[res.Result.ObjectStoreUse] } Vue.prototype.OSSclientConfig.basePath = Vue.prototype.OSSclientConfig.viewEndpoint + console.log(Vue.prototype.OSSclientConfig.basePath) switch (res.Result.ObjectStoreUse) { case 'AliyunOSS': Vue.prototype.OSSclientConfig.bucket = Vue.prototype.OSSclientConfig.bucketName @@ -40,7 +41,7 @@ async function ossGenerateSTS() { if (res && res.url) { resolve({ name: objectName, - url: Vue.prototype.OSSclientConfig.viewEndpoint + objectName + url: res.url }) } else { reject() diff --git a/src/views/system/login-log/index.vue b/src/views/system/login-log/index.vue index 3d66804d..9d96ecb7 100644 --- a/src/views/system/login-log/index.vue +++ b/src/views/system/login-log/index.vue @@ -6,7 +6,11 @@ :label="$t('system:loginLog:label:OptType')" prop="OptType" > - + - + - + - {{ $t('common:button:search') }} + {{ $t("common:button:search") }} - + + - + diff --git a/src/views/trials/trials-myinfo/index.vue b/src/views/trials/trials-myinfo/index.vue index f95be96c..079ad2d6 100644 --- a/src/views/trials/trials-myinfo/index.vue +++ b/src/views/trials/trials-myinfo/index.vue @@ -29,7 +29,7 @@ :IsCanConnectInternet="IsCanConnectInternet" v-if="activeIndex === '2'" /> - + diff --git a/src/views/trials/trials-panel/trial-summary/login-log/index.vue b/src/views/trials/trials-panel/trial-summary/login-log/index.vue index 23e2bfdf..68db8cc2 100644 --- a/src/views/trials/trials-panel/trial-summary/login-log/index.vue +++ b/src/views/trials/trials-panel/trial-summary/login-log/index.vue @@ -13,7 +13,7 @@ > - + + + + @@ -164,7 +173,7 @@ v-if="!isMine" :label="$t('trials:loginLog:table:optUserType')" prop="OptUserTypeEnum" - min-width="90" + min-width="160" show-overflow-tooltip sortable="custom" > @@ -192,7 +201,7 @@