作者 userName

1232

import request from '@/utils/http'
/**
*
*
*/
export const getindex = (id) => {
return request({
method: 'GET',
url: `/list/${id}`,
})
}
export const getImage = (data) => {
return request({
method: 'PATCH',
url: `/update/`,
data: {
tNum: data.id,
url: data.url
}
})
}
export const choosepasswd = (data) => {
return request({
method: 'PATCH',
url: `/updatePassword/${data.id}`,
data :{
oldPwd: data.oldPwd,
newPwd: data.newPwd,
rePwd: data.rePwd
}
})
}
\ No newline at end of file
... ...
import request from "@/utils/http"
export const dengluAPI = (data) => {
export const dengluAPI = (name, password) => {
return request({
url: '/information/login',
url: '/login',
method: 'GET',
data: {
tNum: 2024001,
password: 123456
tNum: name,
password: password
}
})
}
\ No newline at end of file
... ...
... ... @@ -4,7 +4,7 @@ import router from '../router'
import store from '@/store'
import { ElMessage } from 'element-plus'
const request = axios.create({
baseURL: 'http://192.168.3.48:8080/study',
baseURL: 'http://192.168.3.48:8080/manageSystem/teacher',
timeout: 15000, //请求超时
})
... ...
<script setup>
import { choosepasswd, getImage, getindex } from '@/aip/account'
import { ref } from 'vue'
const active = ref(0)
const showCenter = ref(false)
... ... @@ -8,6 +9,32 @@ const showPopup = () => {
console.log(111)
showCenter.value = true
}
const getindexdata = async () => {
const res = await getindex(2024001)
console.log(res)
}
const getImageCode = async () => {
const data = {
id: 2024001,
url: 'http://127.0.0.1:8090/api/account/getImageCode',
}
const res = await getImage(data)
console.log(res)
}
const choosepasswddata = async () => {
const data = {
id: 2024001,
oldPwd: '654321',
newPwd: '123456',
rePwd: '123456',
}
const res = await choosepasswd(data)
console.log(res)
}
// getindexdata()
getImageCode()
// choosepasswddata()
</script>
<template>
<div class="right">
... ... @@ -28,7 +55,7 @@ const showPopup = () => {
</div>
<div class="lie">
<div>工号</div>
<div class="lin">1111111</div>
<div class="lin">{{ 111 }}</div>
</div>
<div class="lie">
<div>手机号</div>
... ... @@ -59,16 +86,17 @@ const showPopup = () => {
<div class="code">
<van-cell-group inset>
<!-- 手机号 -->
<van-field v-model="value" placeholder="187159***14" />
<van-field v-model="value" placeholder="187159***14" />
<!-- 验证码 -->
<van-field
v-model="sms"
center
clearable
placeholder="验证码"
>
<van-field v-model="sms" center clearable placeholder="验证码">
<template #button>
<van-button size="small" color="#6170c3" :text="text" round="true" @click="dbclick"></van-button>
<van-button
size="small"
color="#6170c3"
:text="text"
round="true"
@click="dbclick"
></van-button>
</template>
</van-field>
<!-- 底部按钮 -->
... ... @@ -143,7 +171,7 @@ const showPopup = () => {
}
.code {
margin-top: 60px;
.van-cell{
.van-cell {
margin-bottom: 20px;
border: 1px solid #cacaca;
border-radius: 18px;
... ...
... ... @@ -7,8 +7,13 @@ import { ref } from 'vue'
const username = ref('')
const password = ref('')
const onSubmit = async(values) => {
console.log(values)
const res = await dengluAPI(values)
console.log()
const data = {
tNum : username.value,
password : password.value
}
console.log(data);
const res = await dengluAPI(data)
console.log(res)
}
</script>
... ...