8000 Dev by github-learning · Pull Request #5 · github-learning/vue3-admin · GitHub
[go: up one dir, main page]

Skip to content

Dev #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/apis/config/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ service.interceptors.request.use(

service.interceptors.response.use(
(response) => {
console.log('response', response)
// code
const { code, message } = response.data
if (code !== 200) {
ElMessage.error(message)
return Promise.reject(message)
}
// 这里不用刻意做提示,所有成功都提示,不太友好。只针对特别的操作做提示
// else {
// ElMessage.success(message)
// }

return response.data
},
Expand Down
2 changes: 1 addition & 1 deletion src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const layoutsRoutes: RouteRecordRaw[] = [
name: 'user',
component: () => import('@/views/system/user/index.vue'),
meta: {
title: '用户管理2x'
title: '用户管理'
}
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/views/login/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const { proxy } = getCurrentInstance()!
const { redirect, otherQuery } = useRouteQuery()
const loginState = reactive({
loginForm: {
username: 'test-1',
username: 'test-12',
password: '123456-1'
},
loginRules: {
Expand Down
15 changes: 2 additions & 13 deletions src/views/register/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<el-form-item prop="verPassword">
<el-input
type="password"
v-model.number="registerFormData.verPassword"
v-model="registerFormData.verPassword"
placeholder="请确认密码"
show-password
>
Expand Down Expand Up @@ -81,8 +81,6 @@ import { useRouter } from 'vue-router'
import { reactive, ref } from 'vue'
import type { FormInstance, FormRules } from 'element-plus'
import { register } from '@/apis/user'
import { sleep } from '@/utils/helpers'
const { proxy } = getCurrentInstance()!

const ruleFormRef = ref<FormInstance>()
const loading = ref(false)
Expand Down Expand Up @@ -125,20 +123,11 @@ const submitForm = (formEl: FormInstance | undefined) => {
if (valid) {
loading.value = true
await register(registerFormData)
.then(async (res) => {
proxy?.$message.success(res.message)
await sleep()
.then(() => {
router.push({
path: '/login'
})
})
.catch(() => {
for (const key in registerFormData) {
if (Object.prototype.hasOwnProperty.call(registerFormData, key)) {
registerFormData[key] = ''
}
}
})
.finally(() => {
loading.value = false
})
Expand Down
2 changes: 1 addition & 1 deletion src/views/system/role/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const handleSizeChange = (val: number) => {
pageSize.value = val
}
const handleCurrentChange = (val: number) => {
pageNum.value = val - 1
pageNum.value = val
}
const formatter = (row: IRole) => {
return row.isDefault ? '是' : '否'
Expand Down
0