卖家端申请接口。人口
This commit is contained in:
40
src/store/seller/index.ts
Normal file
40
src/store/seller/index.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Module } from 'vuex'
|
||||
import { RootState } from '../index'
|
||||
import i18n from "@/lang/index";
|
||||
import { Https } from '@/tool/https'
|
||||
import { ApplyStatus } from "./index.d"
|
||||
|
||||
import store from '../index'
|
||||
interface Seller {
|
||||
isSeller: boolean,
|
||||
applyStatus: number,
|
||||
}
|
||||
|
||||
const seller: Module<Seller, RootState> = {
|
||||
namespaced: true,
|
||||
state: {
|
||||
isSeller: false,
|
||||
applyStatus: null,
|
||||
},
|
||||
mutations: {
|
||||
set_isSeller(state: Seller, value: boolean) {
|
||||
state.isSeller = value
|
||||
},
|
||||
set_applyStatus(state: Seller, value: number) {
|
||||
state.applyStatus = value
|
||||
if (value == ApplyStatus.Approved) {
|
||||
state.isSeller = true
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
actions: {
|
||||
get_isSeller({ commit }) {
|
||||
Https.axiosGet(Https.httpUrls.checkSellerDesigner).then(rv => {
|
||||
commit('set_isSeller', !!rv)
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default seller
|
||||
Reference in New Issue
Block a user