修改接口

This commit is contained in:
yangzhq68909 2024-09-19 16:13:33 +08:00
parent 267ba082f0
commit e7bcd4328d
7 changed files with 41 additions and 79 deletions

View File

@ -1,27 +1,4 @@
import {
https
} from '@/utils/http.js';
export function loginApi(config) { // 登录
return https({
url: '/sys/sinopecLogin',
method: 'post',
data: config
})
}
export function queryRoleApi(config) { // 获取角色职位
return https({
url: '/appConnet/app/queryRoleByRoleIds',
method: 'get',
data: config
})
}
export function getUserPermissionApi(config) { // 获取权限
return https({
url: '/sys/permission/getUserPermissionByToken',
method: 'get',
data: config
})
}
import { https } from '@/utils/http.js';
export function taskListApi(config) { // 我的任务列表
return https({
url: '/act/task/list',

22
api/login.js Normal file
View File

@ -0,0 +1,22 @@
import { https } from '@/utils/http.js';
export function loginApi(config) { // 登录
return https({
url: '/sys/sinopecLogin',
method: 'post',
data: config
})
}
export function queryRoleApi(config) { // 获取角色职位
return https({
url: '/appConnet/app/queryRoleByRoleIds',
method: 'get',
data: config
})
}
export function getUserPermissionApi(config) { // 获取权限
return https({
url: '/sys/permission/getUserPermissionByToken',
method: 'get',
data: config
})
}

View File

@ -1,41 +1,33 @@
<template>
<view :class="{'gray':store.isgray==1}">
<view class="logo f-col aic">
<image src="../../static/login/logo.png" mode=""></image>
<image src="@/static/login/logo.png"></image>
</view>
<view class="form f-col aic">
<view class="box f-row aic">
<image src="../../static/login/phone.png" mode=""></image>
<input v-model="username" type="text" placeholder="请输入账号"
<image src="@/static/login/phone.png"></image>
<input v-model="username" type="text" placeholder="请输入统一身份认证"
placeholder-style="font-size: 28rpx;color: #999999;" />
<!-- <view class="account_box" id="account" v-if="showAccount">
<view class="account">
<view class="" v-for="item,i in accountArr" :key="i" @click="chooseAccount(item.un)">
{{item.un}}
</view>
</view>
</view> -->
</view>
<view class="box f-row aic">
<image src="../../static/login/pwd.png" mode=""></image>
<image src="@/static/login/pwd.png"></image>
<input v-model="password" :type="!showpwd?'password':'text'" placeholder="请输入密码"
placeholder-style="font-size: 28rpx;color: #999999;" />
<image v-if="showpwd" src="../../static/login/eye.png" mode="" @click="showpwd=!showpwd"></image>
<image v-else src="../../static/login/eye-off.png" mode="" @click="showpwd=!showpwd"></image>
<image v-if="showpwd" src="@/static/login/eye.png" @click="showpwd = !showpwd"></image>
<image v-else src="@/static/login/eye-off.png" @click="showpwd = !showpwd"></image>
</view>
</view>
<view class="pwd f-row aic">
<view style="display: inline-block;" @click="check = !check">
<view class="f-row aic">
<image v-if="!check" src="../../static/login/nocheck.png" mode=""></image>
<image v-else src="../../static/login/checked.png" mode=""></image>
<image v-if="!check" src="@/static/login/nocheck.png"></image>
<image v-else src="@/static/login/checked.png"></image>
<text>记住密码</text>
</view>
</view>
</view>
<view class="login f-col aic">
<view class="" @click="login">
<view @click="login">
登录
</view>
</view>
@ -51,8 +43,7 @@
import {
loginApi,
queryRoleApi
} from '@/api/api.js';
} from '@/api/login.js';
import Base64 from 'base-64';
import {
onLoad
@ -132,34 +123,8 @@
})
}
const showAccount = ref(false)
let localAccountArr = []
const accountArr = ref([])
// watch(username, (newVal, oldVal) => {
// if (!newVal) {
// showAccount.value = false
// password.value = ''
// return
// }
// let arr = localAccountArr.filter(item => item.un == newVal)
// let arr1 = localAccountArr.filter(item => item.un.indexOf(newVal) != -1)
// if (arr1.length) {
// accountArr.value = arr1
// showAccount.value = true
// } else {
// showAccount.value = false
// }
// if (arr.length) {
// password.value = arr[0].pw
// showAccount.value = false
// }
// });
const chooseAccount = (item) => {
showAccount.value = false
username.value = item
}
onLoad(() => {
if (uni.getStorageSync('accountObj')) {
let obj = JSON.parse(uni.getStorageSync('accountObj'))
@ -169,12 +134,6 @@
// localAccountArr = uni.getStorageSync('accountArr') ? JSON.parse(uni.getStorageSync('accountArr')) : []
// accountArr.value = localAccountArr
})
const closeShowAccount = (e) => {
if (e.target.id !== "account") {
showAccount.value = false
}
}
function getDeviceIp() {
// #ifdef APP-PLUS

View File

@ -142,9 +142,11 @@
faguiApi,
cjzhiduApi,
zhiduApi,
getUserPermissionApi,
cxcDapingApi
} from '@/api/api.js';
import {
getUserPermissionApi
} from '@/api/login.js';
import customNav from '../../component/customNav.vue';
import {
useStore

View File

@ -87,9 +87,11 @@
} from 'vue';
import {
userProfileApi,
queryRoleApi,
taskListApi
} from '@/api/api.js';
import {
queryRoleApi
} from '@/api/login.js';
import {
onLoad,
onShow

View File

@ -64,7 +64,7 @@
} from '@dcloudio/uni-app';
import {
getUserPermissionApi
} from '@/api/api.js';
} from '@/api/login.js';
import {
useStore
} from '@/store';

View File

@ -11,7 +11,7 @@ import {
} from '@/store';
import {
getUserPermissionApi
} from '@/api/api.js'
} from '@/api/login.js'
/**判断用户跳转前是否可以进入该页面*/
export const beforeJump = (url, callback) => {
const store = useStore();