|
@@ -30,18 +30,16 @@
|
|
|
<div class="footer flex justify-center items-center">
|
|
|
- 由采美网提供技术支持 -
|
|
|
</div>
|
|
|
-
|
|
|
- <simple-login></simple-login>
|
|
|
+ <SimpleLogin></SimpleLogin>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { getCookies } from '@/utils/auth'
|
|
|
-import keys from '@/keys.config'
|
|
|
import { mapGetters } from 'vuex'
|
|
|
export default {
|
|
|
computed: {
|
|
|
- ...mapGetters(['userInfo', 'type', 'accessToken']),
|
|
|
+ ...mapGetters(['userInfo', 'type', 'accessToken', 'authUserId']),
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -61,15 +59,15 @@ export default {
|
|
|
},
|
|
|
// 初始化数据页面公共数据
|
|
|
initPageData() {
|
|
|
- const key = this.$route.path.split('/')[1]
|
|
|
+ const id = this.$route.params.template
|
|
|
// 保存页面入口
|
|
|
- this.$store.commit('user/SET_TYPE', key)
|
|
|
+ this.$store.commit('user/SET_TYPE', `${id}/app`)
|
|
|
// 保存用户AppId
|
|
|
- this.$store.commit('user/SET_APPID', keys[key].appId)
|
|
|
+ this.$store.commit('user/SET_AUTHUSERID', id)
|
|
|
|
|
|
// 获取用户信息
|
|
|
const userInfo = getCookies('userInfo')
|
|
|
- if (userInfo) {
|
|
|
+ if (userInfo && userInfo.authUserId === id) {
|
|
|
this.$store.commit('user/SET_USERINFO', JSON.parse(userInfo))
|
|
|
}
|
|
|
// 初始化供应商信息
|
|
@@ -78,10 +76,12 @@ export default {
|
|
|
|
|
|
// 获取供应商信息
|
|
|
async fetchSupplierInfo() {
|
|
|
- const appId = this.$store.getters.appId
|
|
|
try {
|
|
|
- const res = await this.$http.api.fetchSupplierInfo({ appId })
|
|
|
+ const res = await this.$http.api.fetchSupplierInfo({
|
|
|
+ authUserId: this.authUserId,
|
|
|
+ })
|
|
|
this.$store.commit('supplier/SET_SUPPLIER_INFO', res.data)
|
|
|
+ this.$store.commit('user/SET_APPID', res.data.appId)
|
|
|
} catch (error) {
|
|
|
console.log(error)
|
|
|
} finally {
|