| @@ -7,50 +7,15 @@ | |||
| </template> | |||
| <script> | |||
| import { dictByName } from '@/api/dict.js'; | |||
| import { getToken } from '@/utils/auth'; | |||
| import { TokenKey } from '@/settings'; | |||
| export default { | |||
| name: 'App', | |||
| watch: { | |||
| $route() { | |||
| this.initDic(); | |||
| }, | |||
| }, | |||
| mounted() { | |||
| const script = document.createElement('script'); | |||
| script.type = 'text/javascript'; | |||
| script.src = 'https://s9.cnzz.com/z_stat.php?id=1280834206&web_id=1280834206'; | |||
| document.getElementsByTagName('head')[0].appendChild(script); | |||
| }, | |||
| created() { | |||
| this.initDic(); | |||
| }, | |||
| methods: { | |||
| initDic() { | |||
| if (!getToken(TokenKey)) { | |||
| return; | |||
| } | |||
| // 数据集类型 | |||
| dictByName('dataset_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.datasetType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 模型类别 | |||
| dictByName('model_category').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.modelType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 标签类型 | |||
| dictByName('label_type').then((res) => { | |||
| if (res) { | |||
| this.$store.state.app.labelType = res.dictDetails; | |||
| } | |||
| }); | |||
| }, | |||
| /** | |||
| * @description: 获取缩放值 | |||
| * @param { Void } | |||
| @@ -38,7 +38,7 @@ export const API_MODULE_NAME = { | |||
| // 登录、注册参数配置 | |||
| export const loginConfig = { | |||
| //allowRegister: process.env.NODE_ENV !== 'production', // 是否允许注册 | |||
| // allowRegister: process.env.NODE_ENV !== 'production', // 是否允许注册 | |||
| allowRegister: true, // 是否允许注册 | |||
| }; | |||
| @@ -77,9 +77,47 @@ export const atlasConfig = { | |||
| }; | |||
| // demo list | |||
| export const algList = []; | |||
| export const algList = [ | |||
| { | |||
| id: 10, | |||
| auxInfo: '健康状态', | |||
| }, | |||
| { | |||
| id: 11, | |||
| auxInfo: '安全预警', | |||
| }, | |||
| { | |||
| id: 12, | |||
| auxInfo: '异常检测', | |||
| }, | |||
| { | |||
| id: 13, | |||
| auxInfo: '其他', | |||
| }, | |||
| ]; | |||
| export const typeList = []; | |||
| export const typeList = [ | |||
| { | |||
| label: '车端数据', | |||
| value: 102, | |||
| code: 102, | |||
| }, | |||
| { | |||
| label: '桩端数据', | |||
| value: 101, | |||
| code: 101, | |||
| }, | |||
| { | |||
| label: '实验数据', | |||
| value: 105, | |||
| code: 105, | |||
| }, | |||
| { | |||
| label: '其他', | |||
| value: 106, | |||
| code: 106, | |||
| }, | |||
| ]; | |||
| // 根据 code 编码放回标注类型(数据集数据类型) | |||
| export const datasetTypeBy = (valueBy) => (value, key) => { | |||
| @@ -1,18 +1,9 @@ | |||
| /* | |||
| * Copyright 2019-2020 Zheng Jie | |||
| * | |||
| * Licensed under the Apache License, Version 2.0 (the "License"); | |||
| * you may not use this file except in compliance with the License. | |||
| * You may obtain a copy of the License at | |||
| * | |||
| * http://www.apache.org/licenses/LICENSE-2.0 | |||
| * | |||
| * Unless required by applicable law or agreed to in writing, software | |||
| * distributed under the License is distributed on an "AS IS" BASIS, | |||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
| * See the License for the specific language governing permissions and | |||
| * limitations under the License. | |||
| */ | |||
| /* * Copyright 2019-2020 Zheng Jie * * Licensed under the Apache License, Version 2.0 (the | |||
| "License"); * you may not use this file except in compliance with the License. * You may obtain a | |||
| copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by | |||
| applicable law or agreed to in writing, software * distributed under the License is distributed on | |||
| an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See | |||
| the License for the specific language governing permissions and * limitations under the License. */ | |||
| <template> | |||
| <div class="navbar"> | |||
| @@ -23,6 +23,7 @@ import { userMenus } from '@/api/user'; | |||
| import { getToken } from '@/utils/auth'; // getToken from cookie | |||
| import { updateTitle } from '@/utils'; | |||
| import MinioClient from '@/utils/minIO'; | |||
| import { dictByName } from '@/api/dict.js'; | |||
| import constantRoutes from './routes'; | |||
| const originalPush = VueRouter.prototype.push; | |||
| @@ -66,18 +67,6 @@ const loadUserMenus = (next, to) => { | |||
| // 批量服务 -> SDK服务 | |||
| // 在线服务 -> API服务 | |||
| const _res = res.filter((route) => { | |||
| // if (route.name === '云端Serving') { | |||
| // route.meta.title = '云端部署'; | |||
| // const list = route.children.filter((item) => !item.hidden); | |||
| // list.forEach((i) => { | |||
| // if (i?.meta?.title === '在线服务') { | |||
| // i.meta.title = 'API服务'; | |||
| // } | |||
| // if (i?.meta?.title === '批量服务') { | |||
| // i.meta.title = 'SDK服务'; | |||
| // } | |||
| // }); | |||
| // } | |||
| return route.name !== '模型炼知'; | |||
| }); | |||
| @@ -104,6 +93,24 @@ router.beforeEach(async (to, from, next) => { | |||
| const minioClient = await instance.init(); | |||
| window.minioClient = minioClient; | |||
| } | |||
| // 获取字典值 | |||
| dictByName('dataset_type').then((res) => { | |||
| if (res) { | |||
| store.state.app.datasetType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 模型类别 | |||
| dictByName('model_category').then((res) => { | |||
| if (res) { | |||
| store.state.app.modelType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 标签类型 | |||
| dictByName('label_type').then((res) => { | |||
| if (res) { | |||
| store.state.app.labelType = res.dictDetails; | |||
| } | |||
| }); | |||
| // 已登录且要跳转的页面是登录页 | |||
| if (to.path === '/login') { | |||
| next({ path: '/' }); | |||
| @@ -33,7 +33,7 @@ import BatchServingForm from './components/forms/batchServingForm'; | |||
| const FORM_MAP = { | |||
| onlineServing: { | |||
| title: '在线', | |||
| title: 'API', | |||
| listPageName: 'CloudServing', | |||
| submitFunc: { | |||
| add: onlineAdd, | |||
| @@ -41,7 +41,7 @@ const FORM_MAP = { | |||
| }, | |||
| }, | |||
| batchServing: { | |||
| title: '批量', | |||
| title: 'SDK', | |||
| listPageName: 'BatchServing', | |||
| submitFunc: { | |||
| add: batchAdd, | |||
| @@ -363,7 +363,6 @@ import EditDataset from './edit-dataset'; | |||
| import UploadDataFile from './upload-datafile'; | |||
| import '../style/list.scss'; | |||
| import { datasetTypeBy } from '@/config/index'; | |||
| import { dictByName } from '@/api/dict.js'; | |||
| const defaultForm = { | |||
| id: null, | |||
| @@ -419,6 +419,9 @@ export default { | |||
| ? 'Emails cannot be sent more than three times!' | |||
| : '邮件发送不能超过三次!'; | |||
| } | |||
| if (msg === '系统繁忙!') { | |||
| str = this.$i18n.locale === 'en' ? 'The system is busy!' : '系统繁忙!'; | |||
| } | |||
| this.codeLoading = false; | |||
| this.$message({ | |||
| message: str || err.message, | |||
| @@ -34,7 +34,7 @@ the License. * ============================================================= */ | |||
| > | |||
| <el-form-item prop="email"> | |||
| <el-input | |||
| v-model="registerForm.email" | |||
| v-model.trim="registerForm.email" | |||
| auto-complete="on" | |||
| :placeholder="$t('resetPsdEmail')" | |||
| > | |||
| @@ -43,7 +43,7 @@ the License. * ============================================================= */ | |||
| </el-form-item> | |||
| <el-form-item prop="code"> | |||
| <el-input | |||
| v-model="registerForm.code" | |||
| v-model.trim="registerForm.code" | |||
| style="width: 57%" | |||
| :placeholder="$t('resetPsdCode')" | |||
| > | |||
| @@ -248,6 +248,17 @@ export default { | |||
| ? 'The email address format is incorrect' | |||
| : '邮箱地址格式有误'; | |||
| } | |||
| if (msg === '邮件发送不能超过三次!') { | |||
| str = | |||
| this.$i18n.locale === 'en' | |||
| ? 'Emails cannot be sent more than three times!' | |||
| : '邮件发送不能超过三次!'; | |||
| } | |||
| if (msg === '系统繁忙!') { | |||
| str = this.$i18n.locale === 'en' ? 'The system is busy!' : '系统繁忙!'; | |||
| } | |||
| this.$message({ | |||
| message: str || err.message, | |||
| type: 'error', | |||
| @@ -278,8 +289,31 @@ export default { | |||
| }) | |||
| .catch((err) => { | |||
| this.loading = false; | |||
| const msg = err.message; | |||
| let str = ''; | |||
| if (msg === '邮箱验证码已过期!') { | |||
| str = | |||
| this.$i18n.locale === 'en' | |||
| ? 'The email verification code has expired!' | |||
| : '邮箱验证码已过期!'; | |||
| } | |||
| if (msg === '系统繁忙!') { | |||
| str = this.$i18n.locale === 'en' ? 'The system is busy!' : '系统繁忙!'; | |||
| } | |||
| if (msg === '该邮箱未注册!') { | |||
| str = | |||
| this.$i18n.locale === 'en' | |||
| ? 'The email address is not registered!' | |||
| : '该邮箱未注册!'; | |||
| } | |||
| if (msg === '邮箱地址或验证码错误、请重新输入!') { | |||
| str = | |||
| this.$i18n.locale === 'en' | |||
| ? 'Email address or verification code is incorrect, please re-enter it!' | |||
| : '邮箱地址或验证码错误、请重新输入!'; | |||
| } | |||
| this.$message({ | |||
| message: err.message, | |||
| message: str || err.message, | |||
| type: 'error', | |||
| }); | |||
| }); | |||