This commit is contained in:
parent
a6c701250b
commit
64509092eb
|
|
@ -0,0 +1,26 @@
|
||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/dist
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
/package-lock.json
|
||||||
|
.hbuilder
|
||||||
|
unpackage
|
||||||
2
App.vue
2
App.vue
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
// 定义全局数据
|
// 定义全局数据
|
||||||
const $globalData = {
|
const $globalData = {
|
||||||
BASE_URL: 'https://dev.api.leapy.cn',
|
BASE_URL: 'https://dev.api.leapy.cn/merchant/',
|
||||||
RESOURCE_URL: 'https://resource.leapy.cn/staff/'
|
RESOURCE_URL: 'https://resource.leapy.cn/staff/'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,8 @@ export const register = (data : any) => post('/power/drv', data);
|
||||||
|
|
||||||
export const updateUser = (data : any) => put('/power/drv', data);
|
export const updateUser = (data : any) => put('/power/drv', data);
|
||||||
|
|
||||||
export const deleteUser = (data : any) => del('/power/drv', data);
|
export const deleteUser = (data : any) => del('/power/drv', data);
|
||||||
|
|
||||||
|
export const captcha = (data : any) => get('v1/captcha', data);
|
||||||
|
|
||||||
|
export const login = (data : any) => post('v1/login', data);
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li-w-80% li-mx-auto li-mt-100">
|
<view class="li-w-80% li-mx-auto li-mt-100">
|
||||||
<!-- 账号 -->
|
<!-- 账号 -->
|
||||||
<wd-input :maxlength="11" placeholder="请输入账号" type='number' v-model="form.phone" prefix-icon="user"
|
<wd-input :maxlength="11" placeholder="请输入账号" type='number' v-model="form.username" prefix-icon="user"
|
||||||
placeholderStyle="font-size:30rpx" :focus-when-clear="false" clear-trigger="focus" clearable
|
placeholderStyle="font-size:30rpx" :focus-when-clear="false" clear-trigger="focus" clearable
|
||||||
no-border />
|
no-border />
|
||||||
<!-- 密码 -->
|
<!-- 密码 -->
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
prefix-icon="secured" placeholderStyle="font-size:30rpx" :focus-when-clear="false"
|
prefix-icon="secured" placeholderStyle="font-size:30rpx" :focus-when-clear="false"
|
||||||
clear-trigger="focus" clearable no-border />
|
clear-trigger="focus" clearable no-border />
|
||||||
</view>
|
</view>
|
||||||
<view class="li-bg-white li-w-150 li-h-68">
|
<view class="li-bg-white li-w-150 li-h-68" @click="getCode()">
|
||||||
<image class="li-w-150 li-h-68" src="/static/code.jpg" mode=""></image>
|
<image class="li-w-150 li-h-68" :src="captchaData.image" mode=""></image>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -32,9 +32,8 @@
|
||||||
<wd-button @click="login" block custom-class="custom-shadow">登录</wd-button>
|
<wd-button @click="login" block custom-class="custom-shadow">登录</wd-button>
|
||||||
</view>
|
</view>
|
||||||
<!-- -->
|
<!-- -->
|
||||||
<view
|
<view class="li-flex li-items-center li-justify-center li-w-90% li-mx-auto li-text-#a5a5a5 li-text-24 li-mt-32">
|
||||||
class="li-flex li-items-center li-justify-center li-w-90% li-mx-auto li-text-#a5a5a5 li-text-24 li-mt-300">
|
<wd-checkbox checked-color="#2EA1EA" v-model="check" />
|
||||||
<wd-checkbox checked-color="#2EA1EA" v-model="check" @change="handleChange" />
|
|
||||||
阅读并同意
|
阅读并同意
|
||||||
<text class="li-text-#2EA1EA li-mx-10">
|
<text class="li-text-#2EA1EA li-mx-10">
|
||||||
《用户协议》
|
《用户协议》
|
||||||
|
|
@ -49,27 +48,59 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive } from 'vue'
|
import { ref, reactive } from 'vue'
|
||||||
|
import { captcha } from '@/api/login';
|
||||||
|
import { onLoad, onShow } from '@dcloudio/uni-app';
|
||||||
|
import { md5Sync } from "@/uni_modules/tq-encrypt"
|
||||||
|
|
||||||
interface formItem {
|
interface formItem {
|
||||||
phone : string
|
username : string
|
||||||
password : string
|
password : string
|
||||||
code : string
|
code : string,
|
||||||
|
uuid : string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface CaptchaData {
|
||||||
|
uuid : string
|
||||||
|
image : string
|
||||||
|
}
|
||||||
|
|
||||||
const form = ref<formItem>({
|
const form = ref<formItem>({
|
||||||
phone: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
code: ""
|
code: "",
|
||||||
|
uuid : ""
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let captchaData = ref<CaptchaData>({
|
||||||
|
uuid: '',
|
||||||
|
image: ''
|
||||||
|
})
|
||||||
|
|
||||||
const check = ref<boolean>(true)
|
const check = ref<boolean>(true)
|
||||||
|
|
||||||
const handleChange = ({ value }) => {
|
const login = () => {
|
||||||
console.log(value)
|
console.log(md5Sync("123456"))
|
||||||
|
if (!check.value) {
|
||||||
|
uni.showToast({
|
||||||
|
icon: 'none',
|
||||||
|
title: '请阅读并同意《用户协议》和《隐私政策》',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(check)
|
||||||
|
// uni.switchTab({
|
||||||
|
// url:'/pages/index/index'
|
||||||
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
const login = ()=>{
|
onShow(() => {
|
||||||
uni.switchTab({
|
getCode()
|
||||||
url:'/pages/index/index'
|
});
|
||||||
})
|
|
||||||
|
const getCode = async () => {
|
||||||
|
const res = await captcha({})
|
||||||
|
captchaData.value = res.data as CaptchaData
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ function objectToQueryString(obj: Record<string, any>): string {
|
||||||
// 获取基础URL的函数
|
// 获取基础URL的函数
|
||||||
function getBaseUrl() {
|
function getBaseUrl() {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
return uni.$globalData?.BASE_URL || 'https://dev.api.leapy.cn';
|
return uni.$globalData?.BASE_URL || 'https://dev.api.leapy.cn/merchant';
|
||||||
}
|
}
|
||||||
|
|
||||||
// 封装请求函数
|
// 封装请求函数
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue