版权信息修改
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2024-11-25 16:29:34 +08:00
parent 277881a8d1
commit b5b4db84fc
3 changed files with 102 additions and 76 deletions

8
public/config.js Normal file
View File

@ -0,0 +1,8 @@
const config = {
hospital: '复旦大学附属肿瘤医院',
hospitalEN: '',
company: '上海展影医疗科技有限公司',
companyEN: ''
}
export default config

View File

@ -103,8 +103,8 @@ export default {
};
},
mounted() {
this.show = process.env.VUE_APP_OSS_PATH === "/hir_test/dist";
// this.show = false;
// this.show = process.env.VUE_APP_OSS_PATH === "/hir_test/dist";
this.show = true;
},
methods: {
changeValue(target, attr, e) {

View File

@ -25,7 +25,7 @@
<div class="title-container">
<!-- IRC Management System -->
<div class="title">
{{ $t("login:title:system") }}
{{ $t('login:title:system') }}
</div>
</div>
<el-form
@ -100,7 +100,7 @@
size="medium"
@click.native.prevent="handleLogin"
>
{{ $t("login:button:login") }}
{{ $t('login:button:login') }}
</el-button>
<div style="text-align: right">
<!-- Forget password? -->
@ -109,14 +109,14 @@
size="medium"
@click.native.prevent="handleResetPwd"
>
{{ $t("login:button:forgetPassword") }}
{{ $t('login:button:forgetPassword') }}
</el-button>
</div>
</el-form>
</div>
</div>
<div v-if="language === 'zh'" class="login-footer">
<span>Copyright © 2024 上海展影医疗科技有限公司 版权所有</span>
<!-- <span>Copyright © 2024 上海展影医疗科技有限公司 版权所有</span>
<span> | </span>
<a target="_blank" href="https://beian.miit.gov.cn/">
<span> 沪ICP备2021037850-2 </span>
@ -128,7 +128,22 @@
>
<img src="@/assets/filing.png" />
<span>沪公网安备 31011002005859</span>
</a>
</a> -->
<span
>{{ $t('login:copyright:title:construct') }}{{ config.hospital }}</span
>
<span> | </span>
<span>{{ $t('login:copyright:title:support') }}{{ config.company }}</span>
</div>
<div v-else>
<span
>{{ $t('login:copyright:title:construct')
}}{{ config.hospitalEN }}</span
>
<span> | </span>
<span
>{{ $t('login:copyright:title:support') }}{{ config.companyEN }}</span
>
</div>
<Vcode
:show="isShow"
@ -140,32 +155,34 @@
</template>
<script>
import { mapGetters, mapMutations } from "vuex";
import TopLang from "./topLang";
import { mapGetters, mapMutations } from 'vuex'
import TopLang from './topLang'
// import NoticeMarquee from '../trials/trials-layout/components/noticeMarquee'
import Vcode from "vue-puzzle-vcode";
import Img1 from "@/assets/pic-1.png";
import logoImg from "@/assets/zzlogo2.png";
import { getHospital } from "@/api/hospital.js";
import Vcode from 'vue-puzzle-vcode'
import Img1 from '@/assets/pic-1.png'
import logoImg from '@/assets/zzlogo2.png'
import { getHospital } from '@/api/hospital.js'
import config from '/public/config.js'
export default {
name: "Login",
name: 'Login',
components: { TopLang, Vcode },
data() {
return {
config,
logoImg,
VUE_APP_OSS_CONFIG_REGION: process.env.VUE_APP_OSS_CONFIG_REGION,
loginForm: {
username: "",
password: "",
username: '',
password: '',
},
loginRules: {
username: [
{
required: true,
message: this.$t("login:formRule:userName"),
trigger: "blur",
message: this.$t('login:formRule:userName'),
trigger: 'blur',
},
{ max: 20, message: `${this.$t("common:ruleMessage:maxLength")} 20` },
{ max: 20, message: `${this.$t('common:ruleMessage:maxLength')} 20` },
],
password: [
// {
@ -175,14 +192,14 @@ export default {
// },
{
required: true,
message: this.$t("login:formRule:password"),
trigger: "blur",
message: this.$t('login:formRule:password'),
trigger: 'blur',
},
{ max: 20, message: `${this.$t("common:ruleMessage:maxLength")} 20` },
{ max: 20, message: `${this.$t('common:ruleMessage:maxLength')} 20` },
],
},
loading: false,
passwordType: "password",
passwordType: 'password',
loginType: null,
location: null,
isShow: false,
@ -191,19 +208,20 @@ export default {
HospitalLogoPath: null,
HospitalName: null,
},
};
}
},
computed: {
...mapGetters(["asyncRoutes", "routes", "language"]),
...mapGetters(['asyncRoutes', 'routes', 'language']),
},
created() {
this.getInfo();
this.getInfo()
console.log(this.config)
},
mounted() {
this.loginType = this.$route.query.loginType;
this.location = this.$route.query.location;
zzSessionStorage.setItem("loginType", this.loginType);
localStorage.setItem("location", this.location);
this.loginType = this.$route.query.loginType
this.location = this.$route.query.location
zzSessionStorage.setItem('loginType', this.loginType)
localStorage.setItem('location', this.location)
// if (process.env.VUE_APP_OSS_CONFIG_REGION === "oss-us-west-1") {
// this.$i18n.locale = "en";
// this.setLanguage("en");
@ -214,104 +232,104 @@ export default {
// this.setLanguage("en");
// this.$updateDictionary();
// } else {
this.$i18n.locale = "zh";
this.setLanguage("zh");
this.$updateDictionary();
this.$i18n.locale = 'zh'
this.setLanguage('zh')
this.$updateDictionary()
// }
// }
},
methods: {
...mapMutations({ setLanguage: "lang/setLanguage" }),
...mapMutations({ setLanguage: 'lang/setLanguage' }),
//
async getInfo() {
try {
let res = await getHospital();
let res = await getHospital()
if (res.IsSuccess) {
Object.keys(this.hospital).forEach((key) => {
this.hospital[key] = res.Result[key];
});
this.hospital[key] = res.Result[key]
})
}
} catch (err) {
console.log(err);
console.log(err)
}
},
showPwd() {
if (this.passwordType === "password") {
this.passwordType = "";
if (this.passwordType === 'password') {
this.passwordType = ''
} else {
this.passwordType = "password";
this.passwordType = 'password'
}
this.$nextTick(() => {
this.$refs.password.focus();
});
this.$refs.password.focus()
})
},
handleLogin() {
this.loginType = this.$route.query.loginType;
this.loginType = this.$route.query.loginType
this.$refs.loginForm.validate((valid) => {
if (valid) {
// this.isShow = true
this.loginIn();
this.loginIn()
} else {
return false;
return false
}
});
})
},
loginIn() {
this.loading = true;
this.loading = true
this.$store
.dispatch("user/login", this.loginForm)
.dispatch('user/login', this.loginForm)
.then((res) => {
if (!res) {
// ,
this.$message.success(this.$t("login:message:login1"));
this.$message.success(this.$t('login:message:login1'))
setTimeout(() => {
this.$router.push({
path: `/recompose?userName=${this.loginForm.username}`,
});
}, 500);
return;
})
}, 500)
return
}
this.$store.dispatch("permission/generateRoutes").then((res) => {
this.loading = false;
this.$store.dispatch('permission/generateRoutes').then((res) => {
this.loading = false
if (res && res.length > 0) {
this.$store.dispatch("global/getNoticeList");
this.$router.addRoutes(res);
if (this.loginType === "DevOps") {
this.$router.replace({ path: res[0].path });
return;
this.$store.dispatch('global/getNoticeList')
this.$router.addRoutes(res)
if (this.loginType === 'DevOps') {
this.$router.replace({ path: res[0].path })
return
}
if (this.hasPermi(["role:radmin"])) {
this.$router.replace({ path: res[0].path });
return;
if (this.hasPermi(['role:radmin'])) {
this.$router.replace({ path: res[0].path })
return
}
if (
this.hasPermi(["role:pm", "role:oa", "role:admin", "role:dev"])
this.hasPermi(['role:pm', 'role:oa', 'role:admin', 'role:dev'])
) {
this.$router.replace({ path: "/trials/trials-inspection" });
} else if (this.hasPermi(["role:oa"])) {
this.$router.replace({ path: "/system" });
this.$router.replace({ path: '/trials/trials-inspection' })
} else if (this.hasPermi(['role:oa'])) {
this.$router.replace({ path: '/system' })
} else {
this.$router.replace({ path: "/trials" });
this.$router.replace({ path: '/trials' })
}
} else {
//
this.$message.warning(this.$t("login:message:login2"));
this.$message.warning(this.$t('login:message:login2'))
}
});
})
})
.catch(() => {
this.loading = false;
});
this.loading = false
})
},
onSuccess() {
this.isShow = false;
this.loginIn();
this.isShow = false
this.loginIn()
},
handleResetPwd() {
this.$router.push({ name: "Resetpassword" });
this.$router.push({ name: 'Resetpassword' })
},
},
};
}
</script>
<style lang="scss">