|
|
|
@ -21,23 +21,28 @@
|
|
|
|
<wd-form class="mb-24" ref="form" :model="model">
|
|
|
|
<wd-form class="mb-24" ref="form" :model="model">
|
|
|
|
|
|
|
|
|
|
|
|
<view class="rounded-md overflow-hidden">
|
|
|
|
<view class="rounded-md overflow-hidden">
|
|
|
|
<wd-cell-group border>
|
|
|
|
<wd-cell-group border size="large">
|
|
|
|
<wd-transition :duration="400" :show="true" name="fade-left">
|
|
|
|
<wd-transition :duration="400" :show="true" name="fade-left">
|
|
|
|
<wd-input label="用户名" label-width="100px" prop="username" clearable v-model="model.username"
|
|
|
|
<wd-input size="large" label="用户名" label-width="100px" prop="username" clearable v-model="model.username"
|
|
|
|
placeholder="请输入用户名" :rules="[{ required: true, message: '请填写用户名' }]" />
|
|
|
|
placeholder="请输入用户名" :rules="[{ required: true, message: '请填写用户名' }]" />
|
|
|
|
</wd-transition>
|
|
|
|
</wd-transition>
|
|
|
|
|
|
|
|
|
|
|
|
<wd-transition :duration="450" :show="true" name="fade-left">
|
|
|
|
<wd-transition :duration="450" :show="true" name="fade-left">
|
|
|
|
<wd-input label="密码" label-width="100px" prop="password" show-password clearable v-model="model.password"
|
|
|
|
<wd-input size="large" label="密码" label-width="100px" prop="password" show-password clearable v-model="model.password"
|
|
|
|
placeholder="请输入密码" :rules="[{ required: true, message: '请填写密码' }]" />
|
|
|
|
placeholder="请输入密码" :rules="[{ required: true, message: '请填写密码' }]" />
|
|
|
|
</wd-transition>
|
|
|
|
</wd-transition>
|
|
|
|
|
|
|
|
|
|
|
|
</wd-cell-group>
|
|
|
|
</wd-cell-group>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
<view class="footer mt-4 px-6"
|
|
|
|
|
|
|
|
style="text-align: right;font-size: 28rpx;color: #999;display: flex;align-items: center;justify-content: flex-end;">
|
|
|
|
|
|
|
|
记住密码?
|
|
|
|
|
|
|
|
<!-- <checkbox v-model="is_save_user_pwd" style="transform:scale(0.7)" /> -->
|
|
|
|
|
|
|
|
<wd-checkbox v-model="is_save_user_pwd" shape="square"></wd-checkbox >
|
|
|
|
|
|
|
|
</view>
|
|
|
|
<view class="footer mt-4 px-6">
|
|
|
|
<view class="footer mt-4 px-6">
|
|
|
|
<wd-transition :duration="500" :show="true" name="fade-left">
|
|
|
|
<wd-transition :duration="500" :show="true" name="fade-left">
|
|
|
|
<wd-button :loading="loading" type="primary" size="medium" @click="handleSubmit" block>登录</wd-button>
|
|
|
|
<wd-button style="font-size: 20px;padding: 10px;" :loading="loading" type="primary" size="large" @click="handleSubmit" block>登录</wd-button>
|
|
|
|
</wd-transition>
|
|
|
|
</wd-transition>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</wd-form>
|
|
|
|
</wd-form>
|
|
|
|
@ -50,7 +55,7 @@ import user from '@/api/modules/user.js'
|
|
|
|
import systemApi from '@/api/modules/system.js'
|
|
|
|
import systemApi from '@/api/modules/system.js'
|
|
|
|
import utils from '@/utils/utils.js'
|
|
|
|
import utils from '@/utils/utils.js'
|
|
|
|
import md5 from 'js-md5';
|
|
|
|
import md5 from 'js-md5';
|
|
|
|
uni.clearStorage(); // 预防本地数据错误
|
|
|
|
// uni.clearStorage(); // 预防本地数据错误
|
|
|
|
|
|
|
|
|
|
|
|
const webInfo = ref({})
|
|
|
|
const webInfo = ref({})
|
|
|
|
|
|
|
|
|
|
|
|
@ -61,14 +66,15 @@ const getWebInfo = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
getWebInfo()
|
|
|
|
getWebInfo()
|
|
|
|
|
|
|
|
console.log(uni.getStorageSync('user_pwd'), 'user_pwd')
|
|
|
|
|
|
|
|
|
|
|
|
const model = ref({
|
|
|
|
const model = ref({
|
|
|
|
username: "",
|
|
|
|
username: "",
|
|
|
|
password: "",
|
|
|
|
password: "",
|
|
|
|
|
|
|
|
...(uni.getStorageSync('user_pwd') || {})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
const loading = ref(false)
|
|
|
|
|
|
|
|
const is_save_user_pwd = ref(true)
|
|
|
|
const form = ref(null)
|
|
|
|
const form = ref(null)
|
|
|
|
|
|
|
|
|
|
|
|
// if (token) {
|
|
|
|
// if (token) {
|
|
|
|
@ -86,7 +92,9 @@ function handleSubmit() {
|
|
|
|
.validate()
|
|
|
|
.validate()
|
|
|
|
.then(({ valid, errors }) => {
|
|
|
|
.then(({ valid, errors }) => {
|
|
|
|
if (valid) {
|
|
|
|
if (valid) {
|
|
|
|
|
|
|
|
if (is_save_user_pwd.value) {
|
|
|
|
|
|
|
|
uni.setStorageSync("user_pwd", model.value);
|
|
|
|
|
|
|
|
}
|
|
|
|
user.login({
|
|
|
|
user.login({
|
|
|
|
...model.value,
|
|
|
|
...model.value,
|
|
|
|
password: md5(model.value.password)
|
|
|
|
password: md5(model.value.password)
|
|
|
|
|