|
|
|
@ -3,18 +3,18 @@
|
|
|
|
<view class="logo-content align-center justify-center flex">
|
|
|
|
<view class="logo-content align-center justify-center flex">
|
|
|
|
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
|
|
|
|
<image style="width: 100rpx;height: 100rpx;" :src="globalConfig.appInfo.logo" mode="widthFix">
|
|
|
|
</image>
|
|
|
|
</image>
|
|
|
|
<text class="title">若依移动端登录</text>
|
|
|
|
<text class="title">生产运营管理系统</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="login-form-content">
|
|
|
|
<view class="login-form-content">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="iconfont icon-user icon"></view>
|
|
|
|
<view class="iconfont icon-user icon"></view>
|
|
|
|
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
|
|
|
<input v-model="loginForm.username" class="input" type="text" placeholder="请输入账号" maxlength="30" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="input-item flex align-center">
|
|
|
|
<view class="iconfont icon-password icon"></view>
|
|
|
|
<view class="iconfont icon-password icon"></view>
|
|
|
|
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
|
|
|
|
<input v-model="loginForm.password" type="password" class="input" placeholder="请输入密码" maxlength="20" />
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
<view class="input-item flex align-center" style="width: 60%;margin: 0px;" v-if="captchaEnabled">
|
|
|
|
<view v-if="captchaEnabled" class="input-item flex align-center" style="width: 60%;margin: 0px;">
|
|
|
|
<view class="iconfont icon-code icon"></view>
|
|
|
|
<view class="iconfont icon-code icon"></view>
|
|
|
|
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
|
|
|
|
<input v-model="loginForm.code" type="number" class="input" placeholder="请输入验证码" maxlength="4" />
|
|
|
|
<view class="login-code">
|
|
|
|
<view class="login-code">
|
|
|
|
@ -25,11 +25,10 @@
|
|
|
|
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
|
|
|
<button @click="handleLogin" class="login-btn cu-btn block bg-blue lg round">登录</button>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
|
|
<view class="xieyi text-center">
|
|
|
|
<view class="xieyi text-center">
|
|
|
|
<text class="text-grey1">登录即代表同意</text>
|
|
|
|
<text class="text-grey1">登录即代表同意</text>
|
|
|
|
<text @click="handleUserAgrement" class="text-blue">《用户协议》</text>
|
|
|
|
<text class="text-blue">《用户协议》</text>
|
|
|
|
<text @click="handlePrivacy" class="text-blue">《隐私协议》</text>
|
|
|
|
<text class="text-blue">《隐私协议》</text>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
@ -45,29 +44,19 @@ import { wxLogin } from '@/api/oauth';
|
|
|
|
import { setToken } from '@/utils/auth';
|
|
|
|
import { setToken } from '@/utils/auth';
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const codeUrl = ref("");
|
|
|
|
const codeUrl = ref("");
|
|
|
|
const captchaEnabled = ref(true); // 是否开启验证码
|
|
|
|
const captchaEnabled = ref(false); // 是否开启验证码
|
|
|
|
const useWxLogin = ref(false); // 是否使用微信登录
|
|
|
|
|
|
|
|
const globalConfig = ref(config);
|
|
|
|
const globalConfig = ref(config);
|
|
|
|
const loginForm = ref({
|
|
|
|
const loginForm = ref({
|
|
|
|
|
|
|
|
tenantName: '内蒙必硕',
|
|
|
|
username: "admin",
|
|
|
|
username: "admin",
|
|
|
|
password: "admin123",
|
|
|
|
password: "admin123",
|
|
|
|
code: "",
|
|
|
|
captchaVerification: '',
|
|
|
|
|
|
|
|
rememberMe: '',
|
|
|
|
|
|
|
|
code: '',
|
|
|
|
uuid: ''
|
|
|
|
uuid: ''
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (useWxLogin.value) {
|
|
|
|
|
|
|
|
getWxCode().then(res => {
|
|
|
|
|
|
|
|
console.log(res);
|
|
|
|
|
|
|
|
wxLogin('miniapp',res).then(res => {
|
|
|
|
|
|
|
|
if(res.token != null){
|
|
|
|
|
|
|
|
setToken(res.token);
|
|
|
|
|
|
|
|
loginSuccess()
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取图形验证码
|
|
|
|
// 获取图形验证码
|
|
|
|
function getCode() {
|
|
|
|
function getCode() {
|
|
|
|
getCodeImg().then(res => {
|
|
|
|
getCodeImg().then(res => {
|
|
|
|
@ -77,8 +66,8 @@ function getCode() {
|
|
|
|
loginForm.value.uuid = res.uuid
|
|
|
|
loginForm.value.uuid = res.uuid
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// getCode();
|
|
|
|
async function handleLogin() {
|
|
|
|
async function handleLogin() {
|
|
|
|
if (loginForm.value.username === "") {
|
|
|
|
if (loginForm.value.username === "") {
|
|
|
|
modal.msgError("请输入您的账号")
|
|
|
|
modal.msgError("请输入您的账号")
|
|
|
|
@ -113,22 +102,7 @@ function loginSuccess(result) {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 隐私协议
|
|
|
|
|
|
|
|
function handlePrivacy() {
|
|
|
|
|
|
|
|
let site = globalConfig.value.appInfo.agreements[0];
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
|
|
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
// 用户协议
|
|
|
|
|
|
|
|
function handleUserAgrement() {
|
|
|
|
|
|
|
|
let site = globalConfig.value.appInfo.agreements[1]
|
|
|
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
|
|
url: `/pages/common/webview/index?title=${site.title}&url=${site.url}`
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getCode();
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
<style lang="scss">
|
|
|
|
|