数据库: - 新增 odf_checkin/odf_cables/odf_cable_faults/odf_cable_fault_images/odf_user_modules 5张表 - 新增菜单权限和角色分配 SQL 脚本 后台 API (.NET/SqlSugar): - 新增实体模型、DTO、Service、Controller (签到/光缆/故障/图片/用户模块) 前端 APP (UniApp): - 新增 portal/checkin/trunk/cable/fault-list/fault-detail/fault-add/trunk-search/route-plan 9个页面 - 新增 permission/checkin/trunk 服务层 - 新增 navigation/watermark 工具函数 后台管理前端 (ZR.Vue): - 新增光缆管理/干线故障管理/签到记录管理/用户模块权限 4个管理页面 - 新增对应 API 模块和表单组件
116 lines
2.3 KiB
Vue
116 lines
2.3 KiB
Vue
<template>
|
|
<view class="login-page">
|
|
<text class="app-title">绥时录</text>
|
|
|
|
<view class="input-wrap">
|
|
<input
|
|
class="input-field"
|
|
v-model="username"
|
|
placeholder="请输入账号"
|
|
placeholder-class="placeholder"
|
|
/>
|
|
</view>
|
|
|
|
<view class="input-wrap">
|
|
<input
|
|
class="input-field"
|
|
v-model="password"
|
|
placeholder="请输入密码"
|
|
placeholder-class="placeholder"
|
|
password
|
|
/>
|
|
</view>
|
|
|
|
<view class="login-btn" @click="handleLogin">
|
|
<text class="login-btn-text">登录</text>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref } from 'vue'
|
|
import store from '@/store'
|
|
import { appLogin, checkPermission } from '@/services/auth'
|
|
import { getUserModules } from '@/services/permission'
|
|
|
|
const username = ref('')
|
|
const password = ref('')
|
|
|
|
async function handleLogin() {
|
|
const res = await appLogin(username.value, password.value)
|
|
if (res.code === 200) {
|
|
const { jwt, userId, userName } = res.data
|
|
store.setAuth(jwt, userId, userName)
|
|
const permRes = await checkPermission()
|
|
store.isPermission = permRes.code === 200
|
|
// 获取用户功能版块权限
|
|
const modulesRes = await getUserModules()
|
|
if (modulesRes.code === 200) {
|
|
store.setModules(modulesRes.data)
|
|
}
|
|
uni.reLaunch({ url: '/pages/portal/index' })
|
|
} else {
|
|
uni.showToast({ title: res.msg, icon: 'none' })
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.login-page {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
height: 100vh;
|
|
background-image: url('/static/images/login_bg.png');
|
|
background-size: cover;
|
|
background-position: center;
|
|
}
|
|
|
|
.app-title {
|
|
margin-top: 200rpx;
|
|
font-size: 40rpx;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
|
|
.input-wrap {
|
|
margin-top: 60rpx;
|
|
width: 560rpx;
|
|
height: 90rpx;
|
|
background-color: #ECEFF3;
|
|
border: 1rpx solid rgba(0, 0, 0, 0.08);
|
|
border-radius: 20rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 0 24rpx;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.input-field {
|
|
width: 100%;
|
|
height: 100%;
|
|
font-size: 28rpx;
|
|
color: #333;
|
|
}
|
|
|
|
.placeholder {
|
|
color: #999;
|
|
}
|
|
|
|
.login-btn {
|
|
margin-top: 160rpx;
|
|
width: 560rpx;
|
|
height: 90rpx;
|
|
background-color: #1A73EC;
|
|
border-radius: 20rpx;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.login-btn-text {
|
|
font-size: 32rpx;
|
|
color: #fff;
|
|
}
|
|
</style>
|