增加权限配置

This commit is contained in:
BianLzhaoMin 2024-08-27 16:09:01 +08:00
parent fb7892f66b
commit eca75347ce
4 changed files with 678 additions and 546 deletions

33
App.vue
View File

@ -1,20 +1,23 @@
<script> <script>
export default { import store from "./store/user";
onLaunch: function () { export default {
// app onLaunch: function () {
plus.screen.lockOrientation('portrait-primary') // app
console.log('App Launch') plus.screen.lockOrientation("portrait-primary");
}, console.log("App Launch");
onShow: function () { },
console.log('App Show') onShow: async function () {
}, console.log("App Show");
onHide: function () { const { data: res } = await this.$api.index.getUserInfo();
console.log('App Hide') store.commit("SET_PERMISSIONS", res.permissions);
} },
} onHide: function () {
console.log("App Hide");
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
/*每个页面公共css */ /*每个页面公共css */
@import "@/uni_modules/uview-ui/index.scss"; @import "@/uni_modules/uview-ui/index.scss";
</style> </style>

View File

@ -1,392 +1,498 @@
<template> <template>
<view> <view>
<view class="upper-bgd"> <view class="upper-bgd">
<view class="logo"> <view class="logo">
<image src="../../static/logo.png" mode=""></image> <image src="../../static/logo.png" mode=""></image>
</view> </view>
<view class="tit"> <view class="tit"> 智慧仓储管理平台 </view>
智慧仓储管理平台 </view>
</view> <view class="switch-log">
</view> <view
<view class="switch-log"> :class="[{ active: switchStatus == 1 }]"
<view :class="[{ active: switchStatus == 1 }]" @click="switchUpper(1)"> @click="switchUpper(1)">
账号登录 账号登录
</view> </view>
<view :class="[{ active: switchStatus == 2 }]" @click="switchUpper(2)"> <view
手机登录 :class="[{ active: switchStatus == 2 }]"
</view> @click="switchUpper(2)">
</view> 手机登录
<view class="login-area"> </view>
<uni-forms v-show="switchStatus == 1" ref="accountForm" :modelValue="accountFormData" :rules="accountRules" </view>
class="form-area" label-position="top"> <view class="login-area">
<uni-forms-item name="username" required label="用户名" label-width="100"> <uni-forms
<uni-easyinput placeholder="请输入用户名称" maxlength="60" v-show="switchStatus == 1"
v-model="accountFormData.username"></uni-easyinput> ref="accountForm"
</uni-forms-item> :modelValue="accountFormData"
<uni-forms-item name="password" required label="密码" label-width="100"> :rules="accountRules"
<uni-easyinput type="password" placeholder="请输入密码" maxlength="60" class="form-area"
v-model="accountFormData.password"></uni-easyinput> label-position="top">
</uni-forms-item> <uni-forms-item
<text name="username"
style=" required
width: 100%; label="用户名"
display: flex; label-width="100">
justify-content: flex-end; <uni-easyinput
color: #3689FF; placeholder="请输入用户名称"
font-size: 14px; maxlength="60"
" v-model="accountFormData.username"></uni-easyinput>
@click="forgetPwd" </uni-forms-item>
> <uni-forms-item
忘记密码 name="password"
</text> required
<button class="submit-btn" @click="accountSubmit">登录</button> label="密码"
</uni-forms> label-width="100">
<uni-forms v-show="switchStatus == 2" ref="veriForm" :modelValue="veriFormData" :rules="veriRules" <uni-easyinput
class="form-area" label-position="top"> type="password"
<uni-forms-item name="phone" required label="手机号码" label-width="100"> placeholder="请输入密码"
<uni-easyinput placeholder="请输入手机号码" type="number" v-model="veriFormData.phone" maxlength="60"
maxlength="11"></uni-easyinput> v-model="accountFormData.password"></uni-easyinput>
</uni-forms-item> </uni-forms-item>
<uni-forms-item name="code" required label="验证码" label-width="100"> <text
<uni-easyinput type="number" maxlength="6" placeholder="请输入验证码" style="
v-model="veriFormData.code"></uni-easyinput> width: 100%;
<button class="count-down" :disabled="sendDisabled" @click="sendVeriCode" style="font-size: 14px;"> display: flex;
<span v-if="countDownStatus == 0">发送验证码</span> justify-content: flex-end;
<span v-if="countDownStatus == 1"> color: #3689ff;
{{ countDown }}s font-size: 14px;
</span> "
</button> @click="forgetPwd">
</uni-forms-item> 忘记密码
<button class="submit-btn" @click="veriSubmit">登录</button> </text>
</uni-forms> <button class="submit-btn" @click="accountSubmit">登录</button>
</view> </uni-forms>
<u-loading-page :loading="showLoading" color="#000" loading-text="登录中,请稍后..."></u-loading-page> <uni-forms
<u-loading-page :loading="showDownload" color="#000" :loading-text="`下载中,请稍后...${percent}%`"></u-loading-page> v-show="switchStatus == 2"
</view> ref="veriForm"
:modelValue="veriFormData"
:rules="veriRules"
class="form-area"
label-position="top">
<uni-forms-item
name="phone"
required
label="手机号码"
label-width="100">
<uni-easyinput
placeholder="请输入手机号码"
type="number"
v-model="veriFormData.phone"
maxlength="11"></uni-easyinput>
</uni-forms-item>
<uni-forms-item
name="code"
required
label="验证码"
label-width="100">
<uni-easyinput
type="number"
maxlength="6"
placeholder="请输入验证码"
v-model="veriFormData.code"></uni-easyinput>
<button
class="count-down"
:disabled="sendDisabled"
@click="sendVeriCode"
style="font-size: 14px">
<span v-if="countDownStatus == 0">发送验证码</span>
<span v-if="countDownStatus == 1">
{{ countDown }}s
</span>
</button>
</uni-forms-item>
<button class="submit-btn" @click="veriSubmit">登录</button>
</uni-forms>
</view>
<u-loading-page
:loading="showLoading"
color="#000"
loading-text="登录中,请稍后..."></u-loading-page>
<u-loading-page
:loading="showDownload"
color="#000"
:loading-text="`下载中,请稍后...${percent}%`"></u-loading-page>
</view>
</template> </template>
<script> <script>
import { authPath, publicPath, systemPath } from '../../public' import { authPath, publicPath, systemPath } from "../../public";
export default { import store from "../../store/user";
data() { export default {
return { data() {
showLoading: false, return {
showDownload: false, showLoading: false,
accountFormData: { showDownload: false,
username: '', accountFormData: {
password: '' username: "",
}, password: "",
veriFormData: { },
phone: '', veriFormData: {
code: '' phone: "",
}, code: "",
switchStatus: 1, },
countDown: 60, switchStatus: 1,
countDownStatus: 0, countDown: 60,
sendDisabled: false, countDownStatus: 0,
givenCode: '', sendDisabled: false,
accountRules: { givenCode: "",
username: { accountRules: {
rules: [ username: {
{ rules: [
required: true, {
errorMessage: '请输入用户名称!' required: true,
} errorMessage: "请输入用户名称!",
] },
}, ],
password: { },
rules: [ password: {
{ rules: [
required: true, {
errorMessage: '请输入密码!' required: true,
} errorMessage: "请输入密码!",
] },
} ],
}, },
veriRules: { },
phone: { veriRules: {
rules: [ phone: {
{ rules: [
required: true, {
errorMessage: '请输入手机号码!' required: true,
} errorMessage: "请输入手机号码!",
] },
}, ],
code: { },
rules: [ code: {
{ rules: [
required: true, {
errorMessage: '请输入验证码!' required: true,
} errorMessage: "请输入验证码!",
] },
} ],
}, },
percent: '' },
} percent: "",
}, };
methods: { },
switchUpper(count) { methods: {
this.switchStatus = count switchUpper(count) {
}, this.switchStatus = count;
forgetPwd () { },
console.log('忘记密码'); forgetPwd() {
}, console.log("忘记密码");
sendVeriCode() { },
let that = this sendVeriCode() {
let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/ let that = this;
if (!phoneReg.test(that.veriFormData.phone)) { let phoneReg = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
uni.showToast({ if (!phoneReg.test(that.veriFormData.phone)) {
icon: 'none', uni.showToast({
title: '请输入正确格式的手机号!' icon: "none",
}) title: "请输入正确格式的手机号!",
} else { });
that.$api.login.codeLogin({ } else {
phone: String(that.veriFormData.phone) that.$api.login
}).then(res => { .codeLogin({
console.log(res); phone: String(that.veriFormData.phone),
}).catch(err => { })
console.log(err); .then((res) => {
}) console.log(res);
that.countDownStatus = 1 })
that.sendDisabled = true .catch((err) => {
let timeInterval = setInterval(() => { console.log(err);
that.countDown -= 1 });
}, 1000) that.countDownStatus = 1;
let timeOut = setTimeout(() => { that.sendDisabled = true;
that.countDownStatus = 0 let timeInterval = setInterval(() => {
that.countDown = 60 that.countDown -= 1;
that.sendDisabled = false }, 1000);
clearInterval(timeInterval) let timeOut = setTimeout(() => {
clearTimeout(timeOut) that.countDownStatus = 0;
}, 1000 * 60) that.countDown = 60;
} that.sendDisabled = false;
}, clearInterval(timeInterval);
veriSubmit() { clearTimeout(timeOut);
let that = this }, 1000 * 60);
that.$refs.veriForm.validate().then(formRes => { }
that.showLoading = true },
console.log(formRes); veriSubmit() {
that.$api.login.checkCode(formRes).then(res => { let that = this;
console.log(res); that.$refs.veriForm.validate().then((formRes) => {
if (res.data.code == 200) { that.showLoading = true;
uni.setStorageSync('userInfo', res.data.data.login_user) console.log(formRes);
uni.setStorageSync('token', res.data.data.access_token) that.$api.login
uni.setStorageSync('roles', res.data.data.login_user.roles) .checkCode(formRes)
uni.setStorageSync('deptId', res.data.data.login_user.sysUser.dept.deptId) .then((res) => {
uni.showToast({ console.log(res);
icon: 'none', if (res.data.code == 200) {
title: '登录成功!', uni.setStorageSync(
success: () => { "userInfo",
that.showLoading = false res.data.data.login_user
uni.switchTab({ );
url: '/pages/index/index' uni.setStorageSync(
}) "token",
} res.data.data.access_token
}) );
} else { uni.setStorageSync(
uni.showToast({ "roles",
icon: 'none', res.data.data.login_user.roles
title: res.data.msg, );
success: () => { uni.setStorageSync(
that.showLoading = false "deptId",
} res.data.data.login_user.sysUser.dept.deptId
}) );
} uni.showToast({
}).catch(err => { icon: "none",
console.log(err); title: "登录成功!",
}) success: () => {
}) that.showLoading = false;
}, uni.switchTab({
accountSubmit() { url: "/pages/index/index",
let that = this });
that.$refs.accountForm.validate().then(formData => { },
that.showLoading = true });
console.log(formData); } else {
that.$api.login.log(formData).then(res => { uni.showToast({
console.log(res); icon: "none",
if (res.data.code == 200) { title: res.data.msg,
uni.setStorageSync('userInfo', res.data.data.login_user) success: () => {
uni.setStorageSync('token', res.data.data.access_token) that.showLoading = false;
uni.setStorageSync('roles', res.data.data.login_user.roles) },
uni.setStorageSync('pwd', formData.password) });
// uni.setStorageSync('deptId', res.data.data.login_user.sysUser.dept.deptId) }
uni.showToast({ })
icon: 'none', .catch((err) => {
title: '登录成功!', console.log(err);
success: () => { });
that.showLoading = false });
uni.switchTab({ },
url: '/pages/index/index' accountSubmit() {
}) let that = this;
} that.$refs.accountForm.validate().then((formData) => {
}) that.showLoading = true;
} else { console.log(formData);
uni.showToast({ that.$api.login
icon: 'none', .log(formData)
title: res.data.msg, .then(async (res) => {
success: () => { console.log(res);
that.showLoading = false if (res.data.code == 200) {
} uni.setStorageSync(
}) "userInfo",
} res.data.data.login_user
}).catch(err => { );
console.log(err); uni.setStorageSync(
uni.showToast({ "token",
icon: 'none', res.data.data.access_token
title: '网络异常,请稍后再试!', );
success: () => { uni.setStorageSync(
that.showLoading = false "roles",
} res.data.data.login_user.roles
}) );
}) uni.setStorageSync("pwd", formData.password);
}) // uni.setStorageSync('deptId', res.data.data.login_user.sysUser.dept.deptId)
}
}, const { data: resS } =
onShow() { await this.$api.index.getUserInfo();
if (uni.getStorageSync('pwd')) { store.commit(
this.accountFormData.password = uni.getStorageSync('pwd') "SET_PERMISSIONS",
} resS.permissions
}, );
onLoad() { uni.showToast({
let that = this icon: "none",
let nowVer = '' title: "登录成功!",
let serveVer = '' success: () => {
let apkPath = '' that.showLoading = false;
// app },
plus.runtime.getProperty(plus.runtime.appid, (info) => { });
nowVer = info.version.replace(/\./g, '')
}) setTimeout(() => {
// app uni.switchTab({
this.$api.update.fetchAppVer().then(res => { url: "/pages/index/index",
console.log(res); });
if (res.data.code == 200) { }, 500);
serveVer = res.data.data[0].versionName.replace(/\./g, '') } else {
apkPath = res.data.data[0].apkPath uni.showToast({
// icon: "none",
setTimeout(() => { title: res.data.msg,
console.log(nowVer, serveVer, apkPath); success: () => {
if (nowVer < serveVer) { that.showLoading = false;
uni.showModal({ },
title: '版本升级', });
content: '当前版本非最新版本,请前往升级!', }
showCancel: false, })
confirmText: '升级', .catch((err) => {
success: (res) => { console.log(err);
if (res.confirm) { uni.showToast({
that.showDownload = true icon: "none",
uni.hideTabBar() title: "网络异常,请稍后再试!",
let downloadApk = uni.downloadFile({ success: () => {
url: apkPath, that.showLoading = false;
success: (download) => { },
console.log(download); });
if (download.statusCode == 200) { });
plus.runtime.install(download.tempFilePath, { });
force: true },
}, (install) => { },
that.showDownload = false onShow() {
uni.showTabBar() if (uni.getStorageSync("pwd")) {
console.log(install); this.accountFormData.password = uni.getStorageSync("pwd");
}) }
} else { },
uni.showTabBar() onLoad() {
that.showDownload = false let that = this;
uni.showToast({ let nowVer = "";
icon: 'none', let serveVer = "";
title: '下载异常,请稍后再试!' let apkPath = "";
}) // app
} plus.runtime.getProperty(plus.runtime.appid, (info) => {
} nowVer = info.version.replace(/\./g, "");
}) });
downloadApk.onProgressUpdate(res => { // app
that.percent = res.progress this.$api.update
}) .fetchAppVer()
} .then((res) => {
} console.log(res);
}) if (res.data.code == 200) {
} serveVer = res.data.data[0].versionName.replace(
}, 500) /\./g,
} ""
}).catch(err => { );
console.log(err); apkPath = res.data.data[0].apkPath;
}) //
} setTimeout(() => {
} console.log(nowVer, serveVer, apkPath);
if (nowVer < serveVer) {
uni.showModal({
title: "版本升级",
content: "当前版本非最新版本,请前往升级!",
showCancel: false,
confirmText: "升级",
success: (res) => {
if (res.confirm) {
that.showDownload = true;
uni.hideTabBar();
let downloadApk = uni.downloadFile({
url: apkPath,
success: (download) => {
console.log(download);
if (
download.statusCode ==
200
) {
plus.runtime.install(
download.tempFilePath,
{
force: true,
},
(install) => {
that.showDownload = false;
uni.showTabBar();
console.log(
install
);
}
);
} else {
uni.showTabBar();
that.showDownload = false;
uni.showToast({
icon: "none",
title: "下载异常,请稍后再试!",
});
}
},
});
downloadApk.onProgressUpdate(
(res) => {
that.percent = res.progress;
}
);
}
},
});
}
}, 500);
}
})
.catch((err) => {
console.log(err);
});
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
body { body {
background: url('/static/log-bgd.png'); background: url("/static/log-bgd.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.upper-bgd { .upper-bgd {
width: 100%; width: 100%;
height: 25vh; height: 25vh;
box-sizing: border-box; box-sizing: border-box;
padding-top: 10vh; padding-top: 10vh;
.logo { .logo {
width: 20%; width: 20%;
height: 10vh; height: 10vh;
margin: 0 auto; margin: 0 auto;
margin-bottom: 2vh; margin-bottom: 2vh;
image { image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.tit { .tit {
width: 100%; width: 100%;
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
display: flex; display: flex;
justify-content: center; justify-content: center;
color: #3C87F3; color: #3c87f3;
} }
} }
.switch-log { .switch-log {
width: 80%; width: 80%;
height: 100rpx; height: 100rpx;
margin: 6vh auto; margin: 6vh auto;
margin-bottom: 1vh; margin-bottom: 1vh;
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
align-items: center; align-items: center;
font-size: 26rpx; font-size: 26rpx;
.active { .active {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
border-bottom: 4px solid #B4D0FF; border-bottom: 4px solid #b4d0ff;
border-bottom-left-radius: 15rpx; border-bottom-left-radius: 15rpx;
border-bottom-right-radius: 15rpx; border-bottom-right-radius: 15rpx;
} }
} }
.login-area { .login-area {
width: 80%; width: 80%;
box-sizing: border-box; box-sizing: border-box;
padding: 3vh; padding: 3vh;
margin: 0 auto; margin: 0 auto;
background-color: #fff; background-color: #fff;
border-radius: 20rpx; border-radius: 20rpx;
box-shadow: 0 3px 5px #E6EEFE; box-shadow: 0 3px 5px #e6eefe;
.uni-forms-item__content[data-v-61dfc0d0] { .uni-forms-item__content[data-v-61dfc0d0] {
display: flex; display: flex;
} }
.submit-btn { .submit-btn {
background-color: #3888FF; background-color: #3888ff;
margin: 10vh auto; margin: 10vh auto;
margin-bottom: 0; margin-bottom: 0;
border-radius: 50rpx; border-radius: 50rpx;
color: #fff; color: #fff;
font-size: 26rpx; font-size: 26rpx;
} }
} }
</style> </style>

View File

@ -1,170 +1,171 @@
<template> <template>
<view> <view>
<view class="sticky" @click="seeMore">更多</view> <view class="sticky" @click="seeMore">更多</view>
<view class="infos"> <view class="infos">
<view class="info-lef"> <view class="info-lef">
<image src="/static/bg1.jpg" mode=""></image> <image src="/static/bg1.jpg" mode=""></image>
</view> </view>
<view class="info-rig"> <view class="info-rig">
<view class="name">{{ username }}</view> <view class="name">{{ username }}</view>
<view class="phone">{{ phone }}</view> <view class="phone">{{ phone }}</view>
</view> </view>
</view> </view>
<view class="auth"> <view class="auth">
<h4>{{ companyName }}</h4> <h4>{{ companyName }}</h4>
<h4 class="authed"> <h4 class="authed">
<uni-icons style="margin-right: 8rpx; color: #F19600;" type="checkbox-filled"></uni-icons> <uni-icons
<span>已认证</span> style="margin-right: 8rpx; color: #f19600"
</h4> type="checkbox-filled"></uni-icons>
</view> <span>已认证</span>
<u-cell-group style="width: 95%; margin: 15rpx auto;" :border="false"> </h4>
<!-- <u-cell </view>
<u-cell-group style="width: 95%; margin: 15rpx auto" :border="false">
<!-- <u-cell
title="个人信息" title="个人信息"
:isLink="true" :isLink="true"
icon="/static/personal.png" icon="/static/personal.png"
:border="false" :border="false"
> >
</u-cell> --> </u-cell> -->
<u-cell <u-cell
title="修改密码" title="修改密码"
:isLink="true" :isLink="true"
icon="/static/setting.png" icon="/static/setting.png"
url="/pages/fixPwd/fixPwd" url="/pages/fixPwd/fixPwd"
:border="false" :border="false">
> </u-cell>
</u-cell> </u-cell-group>
</u-cell-group> <view class="exit-log" @click="exitLogin"> 退出登录 </view>
<view </view>
class="exit-log"
@click="exitLogin"
>
退出登录
</view>
</view>
</template> </template>
<script> <script>
import { authPath } from '../../public' import { authPath } from "../../public";
export default { import store from "../../store/user";
data() { export default {
return { data() {
companyName: uni.getStorageSync('companyName'), return {
username: uni.getStorageSync('userInfo').username, companyName: uni.getStorageSync("companyName"),
phone: uni.getStorageSync('userInfo').sysUser.phonenumber username: uni.getStorageSync("userInfo").username,
} phone: uni.getStorageSync("userInfo").sysUser.phonenumber,
}, };
methods: { },
exitLogin () { methods: {
let that = this exitLogin() {
uni.showModal({ let that = this;
title: '退出登录', uni.showModal({
content: '确定退出登录吗?', title: "退出登录",
success: (res) => { content: "确定退出登录吗?",
if (res.confirm) { success: (res) => {
that.$api.user.logOut({}, null).then(res => { if (res.confirm) {
console.log(res); that.$api.user
}).catch(err => { .logOut({}, null)
console.log(err); .then((res) => {
}) console.log(res);
uni.removeStorageSync('token') })
uni.removeStorageSync('userInfo') .catch((err) => {
uni.reLaunch({ console.log(err);
url: '/pages/login/login' });
}) uni.removeStorageSync("token");
} uni.removeStorageSync("userInfo");
} store.commit("SET_PERMISSIONS", []);
}) uni.reLaunch({
}, url: "/pages/login/login",
seeMore () { });
console.log('更多'); }
} },
} });
} },
seeMore() {
console.log("更多");
},
},
};
</script> </script>
<style lang="scss"> <style lang="scss">
body{ body {
background: url('/static/user-bgd.png'); background: url("/static/user-bgd.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
position: relative; position: relative;
} }
.sticky{ .sticky {
box-sizing: border-box; box-sizing: border-box;
padding: 10rpx 15rpx 10rpx 30rpx; padding: 10rpx 15rpx 10rpx 30rpx;
border-radius: 30rpx 0 0 30rpx; border-radius: 30rpx 0 0 30rpx;
background-color: #fff; background-color: #fff;
position: absolute; position: absolute;
top: 3vh; top: 3vh;
right: 0; right: 0;
font-size: 12px; font-size: 12px;
} }
.infos{ .infos {
width: 80%; width: 80%;
margin: 6vh auto; margin: 6vh auto;
margin-bottom: 0; margin-bottom: 0;
display: flex; display: flex;
.info-lef{ .info-lef {
width: 18%; width: 18%;
height: 8vh; height: 8vh;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
image{ image {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
} }
.info-rig{ .info-rig {
flex: 1; flex: 1;
box-sizing: border-box; box-sizing: border-box;
padding: 15rpx 25rpx; padding: 15rpx 25rpx;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
view{ view {
color: #fff; color: #fff;
} }
.name{ .name {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
} }
.phone{ .phone {
font-size: 14px; font-size: 14px;
letter-spacing: 5rpx; letter-spacing: 5rpx;
} }
} }
} }
.auth{ .auth {
width: 85%; width: 85%;
display: flex; display: flex;
margin: 2.5vh auto; margin: 2.5vh auto;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
font-size: 30rpx; font-size: 30rpx;
background-color: #ffe8c2; background-color: #ffe8c2;
box-sizing: border-box; box-sizing: border-box;
padding: 1.6vh; padding: 1.6vh;
border-radius: 20rpx 20rpx 0 0; border-radius: 20rpx 20rpx 0 0;
h4{ h4 {
font-weight: normal; font-weight: normal;
} }
.authed{ .authed {
display: flex; display: flex;
align-items: center; align-items: center;
color: #f19600; color: #f19600;
} }
} }
.exit-log{ .exit-log {
margin: 40vh auto; margin: 40vh auto;
margin-bottom: 0; margin-bottom: 0;
width: 70%; width: 70%;
box-sizing: border-box; box-sizing: border-box;
border-radius: 50rpx; border-radius: 50rpx;
padding: 20rpx 0; padding: 20rpx 0;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: #3888FF; background-color: #3888ff;
color: #fff; color: #fff;
} }
</style> </style>

22
store/user.js Normal file
View File

@ -0,0 +1,22 @@
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
const user = new Vuex.Store({
state: {
permissions: []
},
mutations: {
SET_PERMISSIONS: (state, permissions) => {
state.permissions = permissions
}
},
})
export default user