修改接口
This commit is contained in:
parent
267ba082f0
commit
e7bcd4328d
25
api/api.js
25
api/api.js
@ -1,27 +1,4 @@
|
|||||||
import {
|
import { https } from '@/utils/http.js';
|
||||||
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
|
|
||||||
})
|
|
||||||
}
|
|
||||||
export function taskListApi(config) { // 我的任务列表
|
export function taskListApi(config) { // 我的任务列表
|
||||||
return https({
|
return https({
|
||||||
url: '/act/task/list',
|
url: '/act/task/list',
|
||||||
|
22
api/login.js
Normal file
22
api/login.js
Normal 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
|
||||||
|
})
|
||||||
|
}
|
@ -1,41 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<view :class="{'gray':store.isgray==1}">
|
<view :class="{'gray':store.isgray==1}">
|
||||||
<view class="logo f-col aic">
|
<view class="logo f-col aic">
|
||||||
<image src="../../static/login/logo.png" mode=""></image>
|
<image src="@/static/login/logo.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<view class="form f-col aic">
|
<view class="form f-col aic">
|
||||||
<view class="box f-row aic">
|
<view class="box f-row aic">
|
||||||
<image src="../../static/login/phone.png" mode=""></image>
|
<image src="@/static/login/phone.png"></image>
|
||||||
<input v-model="username" type="text" placeholder="请输入账号"
|
<input v-model="username" type="text" placeholder="请输入统一身份认证"
|
||||||
placeholder-style="font-size: 28rpx;color: #999999;" />
|
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>
|
||||||
<view class="box f-row aic">
|
<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="请输入密码"
|
<input v-model="password" :type="!showpwd?'password':'text'" placeholder="请输入密码"
|
||||||
placeholder-style="font-size: 28rpx;color: #999999;" />
|
placeholder-style="font-size: 28rpx;color: #999999;" />
|
||||||
|
<image v-if="showpwd" src="@/static/login/eye.png" @click="showpwd = !showpwd"></image>
|
||||||
<image v-if="showpwd" src="../../static/login/eye.png" mode="" @click="showpwd=!showpwd"></image>
|
<image v-else src="@/static/login/eye-off.png" @click="showpwd = !showpwd"></image>
|
||||||
<image v-else src="../../static/login/eye-off.png" mode="" @click="showpwd=!showpwd"></image>
|
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="pwd f-row aic">
|
<view class="pwd f-row aic">
|
||||||
<view style="display: inline-block;" @click="check = !check">
|
<view style="display: inline-block;" @click="check = !check">
|
||||||
<view class="f-row aic">
|
<view class="f-row aic">
|
||||||
<image v-if="!check" src="../../static/login/nocheck.png" mode=""></image>
|
<image v-if="!check" src="@/static/login/nocheck.png"></image>
|
||||||
<image v-else src="../../static/login/checked.png" mode=""></image>
|
<image v-else src="@/static/login/checked.png"></image>
|
||||||
<text>记住密码</text>
|
<text>记住密码</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="login f-col aic">
|
<view class="login f-col aic">
|
||||||
<view class="" @click="login">
|
<view @click="login">
|
||||||
登录
|
登录
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
@ -51,8 +43,7 @@
|
|||||||
import {
|
import {
|
||||||
loginApi,
|
loginApi,
|
||||||
queryRoleApi
|
queryRoleApi
|
||||||
} from '@/api/api.js';
|
} from '@/api/login.js';
|
||||||
|
|
||||||
import Base64 from 'base-64';
|
import Base64 from 'base-64';
|
||||||
import {
|
import {
|
||||||
onLoad
|
onLoad
|
||||||
@ -132,34 +123,8 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const showAccount = ref(false)
|
|
||||||
let localAccountArr = []
|
let localAccountArr = []
|
||||||
const accountArr = ref([])
|
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(() => {
|
onLoad(() => {
|
||||||
if (uni.getStorageSync('accountObj')) {
|
if (uni.getStorageSync('accountObj')) {
|
||||||
let obj = JSON.parse(uni.getStorageSync('accountObj'))
|
let obj = JSON.parse(uni.getStorageSync('accountObj'))
|
||||||
@ -169,12 +134,6 @@
|
|||||||
// localAccountArr = uni.getStorageSync('accountArr') ? JSON.parse(uni.getStorageSync('accountArr')) : []
|
// localAccountArr = uni.getStorageSync('accountArr') ? JSON.parse(uni.getStorageSync('accountArr')) : []
|
||||||
// accountArr.value = localAccountArr
|
// accountArr.value = localAccountArr
|
||||||
})
|
})
|
||||||
const closeShowAccount = (e) => {
|
|
||||||
if (e.target.id !== "account") {
|
|
||||||
showAccount.value = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDeviceIp() {
|
function getDeviceIp() {
|
||||||
// #ifdef APP-PLUS
|
// #ifdef APP-PLUS
|
||||||
|
|
||||||
|
@ -142,9 +142,11 @@
|
|||||||
faguiApi,
|
faguiApi,
|
||||||
cjzhiduApi,
|
cjzhiduApi,
|
||||||
zhiduApi,
|
zhiduApi,
|
||||||
getUserPermissionApi,
|
|
||||||
cxcDapingApi
|
cxcDapingApi
|
||||||
} from '@/api/api.js';
|
} from '@/api/api.js';
|
||||||
|
import {
|
||||||
|
getUserPermissionApi
|
||||||
|
} from '@/api/login.js';
|
||||||
import customNav from '../../component/customNav.vue';
|
import customNav from '../../component/customNav.vue';
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
|
@ -87,9 +87,11 @@
|
|||||||
} from 'vue';
|
} from 'vue';
|
||||||
import {
|
import {
|
||||||
userProfileApi,
|
userProfileApi,
|
||||||
queryRoleApi,
|
|
||||||
taskListApi
|
taskListApi
|
||||||
} from '@/api/api.js';
|
} from '@/api/api.js';
|
||||||
|
import {
|
||||||
|
queryRoleApi
|
||||||
|
} from '@/api/login.js';
|
||||||
import {
|
import {
|
||||||
onLoad,
|
onLoad,
|
||||||
onShow
|
onShow
|
||||||
|
@ -64,7 +64,7 @@
|
|||||||
} from '@dcloudio/uni-app';
|
} from '@dcloudio/uni-app';
|
||||||
import {
|
import {
|
||||||
getUserPermissionApi
|
getUserPermissionApi
|
||||||
} from '@/api/api.js';
|
} from '@/api/login.js';
|
||||||
import {
|
import {
|
||||||
useStore
|
useStore
|
||||||
} from '@/store';
|
} from '@/store';
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
} from '@/store';
|
} from '@/store';
|
||||||
import {
|
import {
|
||||||
getUserPermissionApi
|
getUserPermissionApi
|
||||||
} from '@/api/api.js'
|
} from '@/api/login.js'
|
||||||
/**判断用户跳转前是否可以进入该页面*/
|
/**判断用户跳转前是否可以进入该页面*/
|
||||||
export const beforeJump = (url, callback) => {
|
export const beforeJump = (url, callback) => {
|
||||||
const store = useStore();
|
const store = useStore();
|
||||||
|
Loading…
Reference in New Issue
Block a user