| | |
| | | import { userLogin } from './apis' |
| | | import { values } from 'lodash'; |
| | | import {getAllRole} from "@/pages/user/apis"; |
| | | import { hasAnyRole } from '@/utils/authority-utils'; |
| | | export default { |
| | | name: 'Login', |
| | | components: {CommonLayout,faceLogin}, |
| | |
| | | |
| | | |
| | | loadRoutes(); |
| | | this.$router.push('/workplace'); |
| | | if (hasAnyRole('1004', roles)) { |
| | | this.$router.push('/user/list'); |
| | | } else { |
| | | this.$router.push('/workplace'); |
| | | } |
| | | this.$message.success(loginRes.msg, 3); |
| | | } else { |
| | | this.error = loginRes.msg |
| | |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="24"> |
| | | <a-form-model-item |
| | | label="下载权限" |
| | | :labelCol="{ span: 8 }" |
| | | :wrapperCol="{ span: 15, offset: 1 }" |
| | | prop="downloadF" |
| | | > |
| | | <a-switch :default-checked="!!info.dloadFlag" @change="changeDload"> |
| | | <a-icon slot="checkedChildren" type="check" /> |
| | | <a-icon slot="unCheckedChildren" type="close" /> |
| | | </a-switch> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-layout-content> |
| | | </a-layout> |
| | |
| | | drole: { |
| | | roleName: "", |
| | | }, |
| | | dloadFlag: 0, |
| | | desc: "4165465", |
| | | }; |
| | | function getBase64(file) { |
| | |
| | | url = baseUrl + "/face/" + this.info.dface.url.split("\\face\\")[1]; |
| | | } |
| | | return url; |
| | | }, |
| | | } |
| | | }, |
| | | props: { |
| | | info: { |
| | |
| | | this.previewImage = file.url || file.preview; |
| | | this.previewVisible = true; |
| | | }, |
| | | checkForm () { |
| | | checkForm() { |
| | | this.$refs.formRef.validate((valid) => { |
| | | if (!valid) { |
| | | this.$message.error("存在未通过检验的表单项"); |
| | |
| | | }, |
| | | submit() { |
| | | let formData = new FormData(); |
| | | let { id, tel, phone, departId, faceId, roleId, name } = this.info; |
| | | let { id, tel, phone, departId, faceId, roleId, name, dloadFlag } = this.info; |
| | | let params = {}; |
| | | let operation; |
| | | if (this.isEdit) { |
| | | operation = editUser; |
| | | params = { id, tel, phone, departId, faceId, roleId }; |
| | | params = { id, tel, phone, departId, faceId, roleId, dloadFlag }; |
| | | } else { |
| | | operation = addUser; |
| | | params = { name, tel, phone, departId, faceId, roleId }; |
| | | params = { name, tel, phone, departId, faceId, roleId, dloadFlag }; |
| | | } |
| | | let json = JSON.stringify(params); |
| | | // console.log(json); |
| | |
| | | resetFields() { |
| | | this.$refs.formRef.resetFields(); |
| | | }, |
| | | changeDload(checked) { |
| | | // console.log(checked, 99) |
| | | this.info.dloadFlag = checked * 1; |
| | | } |
| | | }, |
| | | |
| | | mounted() { |
| | |
| | | icon: 'home', |
| | | page: { |
| | | closable: false |
| | | }, |
| | | authority: { |
| | | role: ['1001', '1002', '1003'], |
| | | } |
| | | }, |
| | | component: () => import('@/pages/workplace'), |
| | |
| | | path: 'draw', |
| | | name: '图纸管理', |
| | | meta: { |
| | | icon: 'dashboard' |
| | | icon: 'dashboard', |
| | | authority: { |
| | | role: ['1001', '1002', '1003'], |
| | | } |
| | | }, |
| | | component: BlankView, |
| | | children: [ |
| | |
| | | icon: 'user', |
| | | page: { |
| | | cacheAble: false |
| | | }, |
| | | authority: { |
| | | role: '1004', |
| | | } |
| | | }, |
| | | component: BlankView, |
| | |
| | | icon: 'profile', |
| | | page: { |
| | | cacheAble: false |
| | | }, |
| | | authority: { |
| | | role: '1004', |
| | | } |
| | | }, |
| | | component: BlankView, |
| | |
| | | }) |
| | | } |
| | | |
| | | export {filterMenu, hasAuthority} |
| | | export {filterMenu, hasAuthority, hasAnyRole} |