123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <template>
- <view class="container launch-container">
- <view class="lauch-min">
- <image src="@/static/logo2.png" class="logo"></image>
- </view>
- <template v-if="!isLogin">
- <button class="goLogin" @click="Login">去登录</button>
- <view class="warn_txt"> ●请登录后查看,仅限内部员工使用 </view>
- </template>
- </view>
- </template>
- <script>
- import { User } from "@/config/api.js";
- export default {
- data() {
- return {
- isLogin: false,
- };
- },
- methods: {
- Login() {
- setTimeout(function () {
- uni.redirectTo({
- url: "/pageMy/login/login",
- });
- }, 500);
- },
- },
- onLoad() {
- // 判断是否有token缓存
- let token = this.$db.get("token");
- if (!token) {
- this.isLogin = false;
- } else {
- // 校验token
- User.checkToken()
- .then((res) => {
- if (res.Ret === 200) {
- this.isLogin = true;
- setTimeout(function () {
- uni.redirectTo({
- url: "/pages/index/index",
- });
- }, 2000);
- } else {
- this.isLogin = false;
- this.$util.toast(res.Msg);
- this.$db.del("token");
- this.$db.del("account");
- }
- })
- .catch((err) => {
- this.$toast(err);
- });
- }
- },
- };
- </script>
- <style lang="scss">
- .launch-container {
- background-color: #376cbb;
- .lauch-min {
- width: 100%;
- position: absolute;
- top: 40%;
- left: 0;
- transform: translateY(-50%);
- .logo {
- display: block;
- width: 582rpx;
- height: 404rpx;
- margin: 0 auto 50rpx;
- }
- .logo-tit {
- text-align: center;
- font-size: 78rpx;
- color: #fff;
- text {
- display: inline-block;
- }
- .logo-tit-first {
- margin-right: 50rpx;
- }
- }
- }
- .goLogin {
- width: 400rpx;
- height: 90rpx;
- line-height: 90rpx;
- position: absolute;
- left: 50%;
- bottom: 15%;
- transform: translateX(-50%);
- color: #fff;
- font-size: 38rpx;
- background-color: #376cbb;
- border: 1rpx solid #fff;
- border-radius: 90rpx;
- }
- .warn_txt {
- width: 100%;
- font-size: 26rpx;
- color: #fff;
- position: absolute;
- left: 0;
- bottom: 8%;
- text-align: center;
- }
- }
- </style>
|