| @@ -393,5 +393,24 @@ export default { | |||
| loseEfficacy: 'lose efficacy', | |||
| restore: 'restore', | |||
| cancel: 'cancel' | |||
| }, | |||
| editPass: { | |||
| username: 'user name', | |||
| pass: 'password', | |||
| checkPass: 'Confirm Password' | |||
| }, | |||
| apiManage: { | |||
| add: 'add', | |||
| time: 'Duration (s)', | |||
| viewKey: 'View Key', | |||
| editAccount: 'Modify login account', | |||
| eddAccount: 'Add login account', | |||
| setTime: 'Set duration', | |||
| associationTemp: 'Association template', | |||
| loginAccount: 'Login account', | |||
| username: 'user name', | |||
| name: 'name', | |||
| pass: 'password', | |||
| phone: 'phone', | |||
| } | |||
| }; | |||
| @@ -392,5 +392,24 @@ export default { | |||
| loseEfficacy: '失效', | |||
| restore: '恢复', | |||
| cancel: '作废' | |||
| }, | |||
| editPass: { | |||
| username: '用户名', | |||
| pass: '密码', | |||
| checkPass: '确认密码' | |||
| }, | |||
| apiManage: { | |||
| add: '新增', | |||
| time: '时长(秒)', | |||
| viewKey: '查看密钥', | |||
| editAccount: '修改登录账号', | |||
| eddAccount: '新增登录账号', | |||
| setTime: '设置时长', | |||
| associationTemp: '关联模版', | |||
| loginAccount: '登录账号', | |||
| username: '用户名', | |||
| name: '名称', | |||
| pass: '密码', | |||
| phone: '手机号', | |||
| } | |||
| }; | |||
| @@ -1,7 +1,7 @@ | |||
| <template> | |||
| <div class="page justify-around"> | |||
| <div class="addbtn"> | |||
| <el-button type="primary" @click="dialogVisible = true"><el-icon><i-ep-plus /></el-icon> 新增</el-button> | |||
| <el-button type="primary" @click="dialogVisible = true"><el-icon><i-ep-plus /></el-icon> {{$t('apiManage.add')}}</el-button> | |||
| </div> | |||
| <el-table | |||
| @@ -53,7 +53,7 @@ | |||
| </el-table-column> | |||
| <el-table-column | |||
| prop="createTime" | |||
| label="时长(秒)" | |||
| :label="$t('apiManage.time')" | |||
| align="center" | |||
| > | |||
| <template #default="scope"> | |||
| @@ -73,10 +73,10 @@ | |||
| type="primary" | |||
| size="small" | |||
| @click="showDetail(scope.row.id)" | |||
| >查看密钥</el-button> | |||
| <el-button link type="primary" size="small" @click="loginAccount(scope.row)">{{ scope.row.mallUserInfo ? '修改登录账号' : '新增登录账号'}}</el-button> | |||
| <el-button link type="primary" size="small" @click="setTime(scope.row.id)">设置时长</el-button> | |||
| <el-button link type="primary" size="small" @click="associationTemp(scope.row.id)">关联模版</el-button> | |||
| >{{$t('apiManage.viewKey')}}</el-button> | |||
| <el-button link type="primary" size="small" @click="loginAccount(scope.row)">{{ scope.row.mallUserInfo ? $t('apiManage.editAccount') : $t('apiManage.eddAccount')}}</el-button> | |||
| <el-button link type="primary" size="small" @click="setTime(scope.row.id)">{{$t('apiManage.setTime')}}</el-button> | |||
| <el-button link type="primary" size="small" @click="associationTemp(scope.row.id)">{{$t('apiManage.associationTemp')}}</el-button> | |||
| </template> | |||
| </el-table-column> | |||
| </el-table> | |||
| @@ -153,20 +153,20 @@ | |||
| </el-dialog> | |||
| <!-- 登录账号 --> | |||
| <el-dialog v-model="accountDialogVisible" v-if="accountDialogVisible" title="登录账号" width="35%" :before-close="handleClose" > | |||
| <el-dialog v-model="accountDialogVisible" v-if="accountDialogVisible" :title="$t('apiManage.loginAccount')" width="35%" :before-close="handleClose" > | |||
| <el-form ref="ruleForm2" label-position="left" label-width="120px" :model="formData2" :rules="rules2"> | |||
| <el-form-item label="用户名" prop="username"> | |||
| <el-form-item :label="$t('apiManage.username')" prop="username"> | |||
| <el-input :disabled="mallUserInfoFlag" v-model="formData2.username" :placeholder="$t('businessMangage.nameInputText')" /> | |||
| </el-form-item> | |||
| <el-form-item label="名称" prop="name" > | |||
| <el-form-item :label="$t('apiManage.name')" prop="name" > | |||
| <el-input v-model="formData2.name" :placeholder="$t('businessMangage.addressInputText')" /> | |||
| </el-form-item> | |||
| <el-form-item label="密码" prop="password"> | |||
| <el-form-item :label="$t('apiManage.pass')" prop="password"> | |||
| <el-input v-model="formData2.password" :placeholder="$t('businessMangage.codeInputText')" /> | |||
| </el-form-item> | |||
| <el-form-item label="手机号" prop="phone"> | |||
| <el-form-item :label="$t('apiManage.phone')" prop="phone"> | |||
| <el-input v-model="formData2.phone" :placeholder="$t('businessMangage.codeInputText')" /> | |||
| </el-form-item> | |||
| </el-form> | |||
| @@ -181,7 +181,7 @@ | |||
| </span> | |||
| </template> | |||
| </el-dialog> | |||
| <el-dialog v-model="modelDialogVisible" v-if="modelDialogVisible" title="关联模版" width="60%" :before-close="handleClose" > | |||
| <el-dialog v-model="modelDialogVisible" v-if="modelDialogVisible" :title="$t('apiManage.associationTemp')" width="60%" :before-close="handleClose" > | |||
| <model :serviceId="serviceId" @close="handleClose"></model> | |||
| </el-dialog> | |||
| @@ -1,10 +1,3 @@ | |||
| <!-- | |||
| * @Autor: Chutingting | |||
| * @Date: 2023-11-05 19:03:11 | |||
| * @LastEditors: Chutingting | |||
| * @LastEditTime: 2023-11-10 14:48:56 | |||
| * @Description: 修改密码 | |||
| --> | |||
| <template> | |||
| <div class="page"> | |||
| <el-form | |||
| @@ -15,13 +8,13 @@ | |||
| label-width="120px" | |||
| class="editPass" | |||
| > | |||
| <el-form-item label="用户名" prop="pass"> | |||
| <el-form-item :label="$t('editPass.username')" prop="pass"> | |||
| <el-input v-model="ruleForm.userName" disabled autocomplete="off" /> | |||
| </el-form-item> | |||
| <el-form-item label="密码" prop="pass"> | |||
| <el-form-item :label="$t('editPass.pass')" prop="pass"> | |||
| <el-input v-model="ruleForm.pass" type="password" autocomplete="off" /> | |||
| </el-form-item> | |||
| <el-form-item label="确认密码" prop="checkPass"> | |||
| <el-form-item :label="$t('editPass.checkPass')" prop="checkPass"> | |||
| <el-input | |||
| v-model="ruleForm.checkPass" | |||
| type="password" | |||
| @@ -43,6 +36,11 @@ import { updatepwd } from "@/apis/editPass.js"; | |||
| import { logoutApi } from '@/apis/login.js' | |||
| import { userInfoModules } from "@/store/modules/userInfo"; | |||
| import { useRoute, useRouter } from "vue-router"; | |||
| import { useI18n } from "vue-i18n"; | |||
| const { locale } = useI18n(); | |||
| const lanChange = ref(locale); | |||
| const userInfoPinia = userInfoModules(); | |||
| const router = useRouter(); | |||
| const emit = defineEmits(["close"]); | |||
| @@ -51,7 +49,7 @@ const ruleFormRef = ref<FormInstance>() | |||
| const validatePass = (rule: any, value: any, callback: any) => { | |||
| if (value === '') { | |||
| callback(new Error('请输入密码')) | |||
| callback(new Error(lanChange.value == "zh-cn" ? '请输入密码' : 'Please enter the password')) | |||
| } else { | |||
| if (ruleForm.checkPass !== '') { | |||
| if (!ruleFormRef.value) return | |||
| @@ -62,9 +60,9 @@ const validatePass = (rule: any, value: any, callback: any) => { | |||
| } | |||
| const validatePass2 = (rule: any, value: any, callback: any) => { | |||
| if (value === '') { | |||
| callback(new Error('请重新输入密码')) | |||
| callback(new Error(lanChange.value == "zh-cn" ? '请重新输入密码' : 'Please re-enter the password')) | |||
| } else if (value !== ruleForm.pass) { | |||
| callback(new Error("两次密码不一致")) | |||
| callback(new Error(lanChange.value == "zh-cn" ? "两次密码不一致" : 'The two passwords do not match')) | |||
| } else { | |||
| callback() | |||
| } | |||
| @@ -92,7 +90,7 @@ const submitForm = (formEl: FormInstance | undefined) => { | |||
| try { | |||
| const res = await updatepwd(data); | |||
| if (res.code == 200) { | |||
| ElMessage.success("修改成功!"); | |||
| ElMessage.success( lanChange.value == "zh-cn" ? "修改成功!" : 'Modified successfully!'); | |||
| logoutApi().then(d => { | |||
| userInfoPinia.loginOut(); | |||
| router.push(`/login`); | |||