li.shaoyi 2 éve
szülő
commit
452d4f98dc

+ 4 - 1
src/business/common/index.ts

@@ -9,7 +9,10 @@ export async function checkToken() {
     try {
         return await tokenCheck()
     } catch (err) {
-        eventBus.$emit('LogoutNotify')
+        // 临时解决方案,有可能出现网络问题导致超时后账号被登出
+        if (err !== '令牌无效') {
+            eventBus.$emit('LogoutNotify')
+        }
         return Promise.reject(err)
     }
 }

+ 10 - 5
src/business/login/index.ts

@@ -1,12 +1,12 @@
 import { shallowRef, reactive } from 'vue'
 import { timerTask } from '@/utils/timer'
-import { login } from '@/services/api/account'
+import { login, logout } from '@/services/api/account'
 import { useLoginStore, useEnumStore, useErrorInfoStore, useUserStore, useFuturesStore, useAccountStore } from '@/stores'
 import service from '@/services'
 import tradeSocket from '@/services/websocket/trade'
 import quoteSocket from '@/services/websocket/quote'
 import eventBus from '@/services/bus'
-import { checkToken } from '@/business/common'
+import { checkToken, checkTokenLoop, stopCheckToken } from '@/business/common'
 import { encryptBody } from '@/services/websocket/package/crypto'
 
 /**
@@ -48,6 +48,7 @@ export function useLogin(persist = false) {
         futuresStore.getGoodsList()
         tradeSocket.connect()
         quoteSocket.connect()
+        checkTokenLoop()
     }
 
     // 用户登录
@@ -83,12 +84,16 @@ export function useLogin(persist = false) {
 
     // 用户登出
     const userLogout = (callback?: () => void) => {
+        stopCheckToken()
         tradeSocket.close()
         quoteSocket.close()
         timerTask.clearAll()
-        loginStore.clearAutoLoginData()
-        loginStore.clearLoginInfo()
-        callback && callback()
+
+        logout().finally(() => {
+            loginStore.clearAutoLoginData()
+            loginStore.clearLoginInfo()
+            callback && callback()
+        })
     }
 
     // 初始化业务数据

+ 8 - 1
src/packages/pc/components/modules/quote/forex/index.less

@@ -7,7 +7,6 @@
         flex: 1;
         display: flex;
         flex-direction: column;
-        justify-content: space-evenly;
         padding: 5px;
 
         +ul {
@@ -32,5 +31,13 @@
                 }
             }
         }
+
+        &.top li {
+            margin-top: auto;
+        }
+
+        &.bottom li {
+            margin-bottom: auto;
+        }
     }
 }

+ 30 - 30
src/packages/pc/components/modules/quote/forex/index.vue

@@ -1,57 +1,57 @@
 <template>
     <div class="app-quote-forex">
-        <ul>
-            <li @click="onSellClick(5)">
+        <ul class="top" v-if="quote">
+            <li @click="onSellClick(5)" v-if="quote.quotegear > 4">
                 <span>卖五</span>
-                <span :class="quote?.ask5Color">{{ handleNumberValue(quote?.ask5) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume5) }}</span>
+                <span :class="quote.ask5Color">{{ handleNumberValue(quote.ask5.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume5) }}</span>
             </li>
-            <li @click="onSellClick(4)">
+            <li @click="onSellClick(4)" v-if="quote.quotegear > 3">
                 <span>卖四</span>
-                <span :class="quote?.ask4Color">{{ handleNumberValue(quote?.ask4) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume4) }}</span>
+                <span :class="quote.ask4Color">{{ handleNumberValue(quote.ask4.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume4) }}</span>
             </li>
-            <li @click="onSellClick(3)">
+            <li @click="onSellClick(3)" v-if="quote.quotegear > 2">
                 <span>卖三</span>
-                <span :class="quote?.ask3Color">{{ handleNumberValue(quote?.ask3) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume3) }}</span>
+                <span :class="quote.ask3Color">{{ handleNumberValue(quote.ask3.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume3) }}</span>
             </li>
-            <li @click="onSellClick(2)">
+            <li @click="onSellClick(2)" v-if="quote.quotegear > 1">
                 <span>卖二</span>
-                <span :class="quote?.ask2Color">{{ handleNumberValue(quote?.ask2) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume2) }}</span>
+                <span :class="quote.ask2Color">{{ handleNumberValue(quote.ask2.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume2) }}</span>
             </li>
             <li @click="onSellClick(1)">
                 <span>卖一</span>
-                <span :class="quote?.askColor">{{ handleNumberValue(quote?.ask) }}</span>
-                <span>{{ handleNumberValue(quote?.askvolume) }}</span>
+                <span :class="quote.askColor">{{ handleNumberValue(quote.ask.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.askvolume) }}</span>
             </li>
         </ul>
-        <ul>
+        <ul class="bottom" v-if="quote">
             <li @click="onBuyClick(1)">
                 <span>买一</span>
-                <span :class="quote?.bidColor">{{ handleNumberValue(quote?.bid) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume) }}</span>
+                <span :class="quote.bidColor">{{ handleNumberValue(quote.bid.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume) }}</span>
             </li>
-            <li @click="onBuyClick(2)">
+            <li @click="onBuyClick(2)" v-if="quote.quotegear > 1">
                 <span>买二</span>
-                <span :class="quote?.bid2Color">{{ handleNumberValue(quote?.bid2) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume2) }}</span>
+                <span :class="quote.bid2Color">{{ handleNumberValue(quote.bid2.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume2) }}</span>
             </li>
-            <li @click="onBuyClick(3)">
+            <li @click="onBuyClick(3)" v-if="quote.quotegear > 2">
                 <span>买三</span>
-                <span :class="quote?.bid3Color">{{ handleNumberValue(quote?.bid3) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume3) }}</span>
+                <span :class="quote.bid3Color">{{ handleNumberValue(quote.bid3.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume3) }}</span>
             </li>
-            <li @click="onBuyClick(4)">
+            <li @click="onBuyClick(4)" v-if="quote.quotegear > 3">
                 <span>买四</span>
-                <span :class="quote?.bid4Color">{{ handleNumberValue(quote?.bid4) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume4) }}</span>
+                <span :class="quote.bid4Color">{{ handleNumberValue(quote.bid4.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume4) }}</span>
             </li>
-            <li @click="onBuyClick(5)">
+            <li @click="onBuyClick(5)" v-if="quote.quotegear > 4">
                 <span>买五</span>
-                <span :class="quote?.bid5Color">{{ handleNumberValue(quote?.bid5) }}</span>
-                <span>{{ handleNumberValue(quote?.bidvolume5) }}</span>
+                <span :class="quote.bid5Color">{{ handleNumberValue(quote.bid5.toFixed(quote.decimalplace)) }}</span>
+                <span>{{ handleNumberValue(quote.bidvolume5) }}</span>
             </li>
         </ul>
     </div>

+ 11 - 11
src/packages/pc/components/modules/quote/price/index.vue

@@ -7,7 +7,7 @@
             </div>
             <div class="block-bottom">
                 <div class="block-bottom-left">
-                    <span :class="quote.lastColor">{{ handleNumberValue(quote.last) }}</span>
+                    <span :class="quote.lastColor">{{ handleNumberValue(quote.last.toFixed(quote.decimalplace)) }}</span>
                 </div>
                 <div class="block-bottom-right">
                     <span :class="quote.lastColor">{{ quote.rise.toFixed(quote.decimalplace) }}</span>
@@ -19,31 +19,33 @@
             <ul>
                 <li>
                     <span>开盘</span>
-                    <span>{{ handleNumberValue(quote.opened) }}</span>
+                    <span>{{ handleNumberValue(quote.opened.toFixed(quote.decimalplace)) }}</span>
                 </li>
                 <li>
                     <span>昨结</span>
-                    <span>{{ handleNumberValue(quote.presettle) }}</span>
+                    <span>{{ handleNumberValue(quote.presettle.toFixed(quote.decimalplace)) }}</span>
                 </li>
                 <li>
                     <span>最高</span>
-                    <span :class="quote.highestColor">{{ handleNumberValue(quote.highest) }}</span>
+                    <span :class="quote.highestColor">{{ handleNumberValue(quote.highest.toFixed(quote.decimalplace))
+                    }}</span>
                 </li>
                 <li>
                     <span>最低</span>
-                    <span :class="quote.lowestColor">{{ handleNumberValue(quote.lowest) }}</span>
+                    <span :class="quote.lowestColor">{{ handleNumberValue(quote.lowest.toFixed(quote.decimalplace))
+                    }}</span>
                 </li>
                 <li>
                     <span>涨停</span>
-                    <span class="g-price-up">{{ handleNumberValue(quote.limitup) }}</span>
+                    <span class="g-price-up">{{ handleNumberValue(quote.limitup.toFixed(quote.decimalplace)) }}</span>
                 </li>
                 <li>
                     <span>跌停</span>
-                    <span class="g-price-down">{{ handleNumberValue(quote.limitdown) }}</span>
+                    <span class="g-price-down">{{ handleNumberValue(quote.limitdown.toFixed(quote.decimalplace)) }}</span>
                 </li>
                 <li>
                     <span>均价</span>
-                    <span>{{ handleNumberValue(quote.averageprice) }}</span>
+                    <span>{{ handleNumberValue(quote.averageprice.toFixed(quote.decimalplace)) }}</span>
                 </li>
                 <li>
                     <span>振幅</span>
@@ -75,6 +77,4 @@ onMounted(() => subscribe.start(props.goodsCode))
 onUnmounted(() => subscribe.stop())
 </script>
 
-<style lang="less">
-@import './index.less';
-</style>
+<style lang="less">@import './index.less';</style>

+ 10 - 10
src/packages/pc/views/market/trade/goods/index.vue

@@ -60,7 +60,7 @@ const { componentRef, componentId, openComponent, closeComponent } = useComponen
 const tableList = computed(() => {
     return quoteGoodsList.value.map((item) => {
         const quote = futuresStore.getQuoteInfo(item.goodscode)
-        const { bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened } = quote.value ?? {}
+        const { bid, bidColor, bidvolume, ask, askColor, askvolume, limitdown, limitup, lastColor, openedColor, lowestColor, highestColor, last, presettle, rise, change, amplitude, highest, lowest, opened, decimalplace } = quote.value ?? {}
         return {
             ...item,
             lastColor,
@@ -69,20 +69,20 @@ const tableList = computed(() => {
             highestColor,
             askColor,
             bidColor,
-            bid: handleNumberValue(bid),
+            bid: handleNumberValue(bid?.toFixed(decimalplace)),
             bidvolume: handleNumberValue(bidvolume),
-            ask: handleNumberValue(ask),
+            ask: handleNumberValue(ask?.toFixed(decimalplace)),
             askvolume: handleNumberValue(askvolume),
-            last: handleNumberValue(last),
+            last: handleNumberValue(last?.toFixed(decimalplace)),
             rise: rise?.toFixed(item.decimalplace),
             change: parsePercent(change),
-            opened: handleNumberValue(opened),
-            presettle: handleNumberValue(presettle),
-            lowest: handleNumberValue(lowest),
-            highest: handleNumberValue(highest),
+            opened: handleNumberValue(opened?.toFixed(decimalplace)),
+            presettle: handleNumberValue(presettle?.toFixed(decimalplace)),
+            lowest: handleNumberValue(lowest?.toFixed(decimalplace)),
+            highest: handleNumberValue(highest?.toFixed(decimalplace)),
             amplitude: parsePercent(amplitude),
-            limitdown: handleNumberValue(limitdown),
-            limitup: handleNumberValue(limitup),
+            limitdown: handleNumberValue(limitdown?.toFixed(decimalplace)),
+            limitup: handleNumberValue(limitup?.toFixed(decimalplace)),
         }
     })
 })

+ 8 - 4
src/packages/pc/views/market/trade/spot/index.vue

@@ -2,11 +2,13 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading" @row-click="onRowClick" showIndex>
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading" />
+            <app-filter :options="filterOptons" />
+        </template>
+        <template #footer>
+            <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)"
+                @closed="closeComponent" v-if="componentId" />
         </template>
     </app-table>
-    <component ref="componentRef" v-bind="{ selectedRow }" :is="componentMap.get(componentId)" @closed="closeComponent"
-        v-if="componentId" />
 </template>
 
 <script lang="ts" setup>
@@ -20,6 +22,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 
 const componentMap = new Map<string, unknown>([
     ['order', defineAsyncComponent(() => import('./order/index.vue'))], // 买卖大厅
+    ['listing', defineAsyncComponent(() => import('./listing/index.vue'))], // 挂牌求购
 ])
 
 const { componentRef, componentId, openComponent, closeComponent } = useComponent(() => run(), false)
@@ -52,7 +55,8 @@ filterOptons.selectList = [
 
 filterOptons.buttonList = [
     { lable: '查询', className: 'el-button--info', onClick: () => onSearch() },
-    { lable: '重置', className: 'el-button--info', onClick: () => onSearch(true) }
+    { lable: '重置', className: 'el-button--info', onClick: () => onSearch(true) },
+    { lable: '挂牌求购', className: 'el-button--primary', onClick: () => openComponent('listing') }
 ]
 
 const onSearch = (clear = false) => {

+ 163 - 0
src/packages/pc/views/market/trade/spot/listing/index.vue

@@ -0,0 +1,163 @@
+<!-- 交易市场-仓单交易-挂牌 -->
+<template>
+    <app-drawer title="挂牌" v-model:show="show" :width="800" :loading="loading" :refresh="refresh">
+        <el-form ref="formRef" class="el-form--horizontal" label-width="100px" :model="formData" :rules="formRules">
+            <el-form-item prop="PerformanceTemplateID" label="履约方式">
+                <Performance :market-id="17201" v-model="formData.PerformanceTemplateID" />
+            </el-form-item>
+            <el-form-item prop="DeliveryGoodsID" label="品类">
+                <el-select placeholder="请选择" v-model="formData.DeliveryGoodsID" @change="onDeliveryGoodsChange">
+                    <el-option :label="item.deliverygoodsname" :value="item.deliverygoodsid"
+                        v-for="(item, index) in ftDeliveryGoodsList" :key="index" />
+                </el-select>
+            </el-form-item>
+            <el-form-item prop="WRStandardID" label="商品">
+                <el-select placeholder="请选择" v-model="formData.WRStandardID" @change="onGoodsChange">
+                    <el-option :label="item.wrstandardname" :value="item.wrstandardid" v-for="(item, index) in goodsList"
+                        :key="index" />
+                </el-select>
+            </el-form-item>
+            <el-form-item prop="dgFactoryItemId" label="仓库">
+                <el-select placeholder="请选择" v-model="dgFactoryItemId" @change="onWarehouseChange">
+                    <el-option :label="item.dgfactoryitemvalue" :value="item.dgfactoryitemid"
+                        v-for="(item, index) in warehouseList" :key="index" />
+                </el-select>
+            </el-form-item>
+            <el-form-item prop="FixedPrice" label="挂牌价格">
+                <el-input-number placeholder="请输入" :min="0" :precision="2" v-model="formData.FixedPrice" />
+            </el-form-item>
+            <el-form-item prop="OrderQty" label="挂牌数量">
+                <el-input-number placeholder="请输入" :min="0" :precision="0" v-model="formData.OrderQty" />
+            </el-form-item>
+            <el-form-item label="货款金额">
+                <span>{{ amount }}</span>
+            </el-form-item>
+            <el-form-item label="可用资金">
+                <span>{{ accountStore.avaiableMoney.toFixed(2) }}</span>
+            </el-form-item>
+        </el-form>
+        <template #footer>
+            <el-button type="info" @click="onCancel(false)">取消</el-button>
+            <el-button type="primary" @click="onSubmit">提交</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { shallowRef, computed } from 'vue'
+import { ElMessage, FormInstance, FormRules } from 'element-plus'
+import { BuyOrSell } from '@/constants/order'
+import { useRequest } from '@/hooks/request'
+import { queryFtDeliveryGoods, queryWrStandardFactoryItem } from '@/services/api/goods'
+import { useHdWROrder } from '@/business/trade'
+import { useAccountStore } from '@/stores'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import Performance from '@pc/components/modules/performance/index.vue'
+
+const { formData, listingSubmit, loading, amount } = useHdWROrder()
+const accountStore = useAccountStore()
+const show = shallowRef(true)
+const refresh = shallowRef(false)
+const formRef = shallowRef<FormInstance>()
+const dgFactoryItemId = shallowRef<number>()
+
+const { dataList: ftDeliveryGoodsList } = useRequest(queryFtDeliveryGoods)
+const { dataList: wrStandardFactoryItems, run: getWrStandardFactoryItems } = useRequest(queryWrStandardFactoryItem, { manual: true })
+const goodsList = shallowRef<Model.FtDeliveryGoodsRsp['wdlst']>([]) // 商品列表
+
+// 仓库列表
+const warehouseList = computed(() => {
+    return wrStandardFactoryItems.value.reduce((res, item) => [...res, ...item.itemlst], [] as Model.WrStandardFactoryItemRsp['itemlst'])
+})
+
+const formRules: FormRules = {
+    PerformanceTemplateID: [{
+        required: true,
+        message: '请选择履约方式'
+    }],
+    DeliveryGoodsID: [{
+        required: true,
+        message: '请选择品类'
+    }],
+    WRStandardID: [{
+        required: true,
+        message: '请选择商品'
+    }],
+    dgFactoryItemId: [{
+        required: true,
+        validator: (rule, value, callback) => {
+            if (dgFactoryItemId.value) {
+                callback()
+            } else {
+                callback(new Error('请选择仓库'))
+            }
+        }
+    }],
+    FixedPrice: [{
+        required: true,
+        validator: (rule, value, callback) => {
+            if (value) {
+                callback()
+            } else {
+                callback(new Error('请输入挂牌价格'))
+            }
+        }
+    }],
+    OrderQty: [{
+        required: true,
+        validator: (rule, value, callback) => {
+            if (value) {
+                callback()
+            } else {
+                callback(new Error('请输入挂牌数量'))
+            }
+        }
+    }],
+}
+
+// 选择品类时触发
+const onDeliveryGoodsChange = (deliverygoodsid: number) => {
+    const item = ftDeliveryGoodsList.value.find((e) => e.deliverygoodsid === deliverygoodsid)
+    if (item) {
+        goodsList.value = item.wdlst
+    }
+    formData.WRStandardID = undefined
+    formData.FactoryItems = undefined
+    dgFactoryItemId.value = undefined
+}
+
+// 选择商品时触发
+const onGoodsChange = (wrstandardid: number) => {
+    formData.FactoryItems = undefined
+    dgFactoryItemId.value = undefined
+    getWrStandardFactoryItems({ wrstandardid })
+}
+
+// 选择仓库时触发
+const onWarehouseChange = (dgfactoryitemid: number) => {
+    formData.FactoryItems = [{
+        DGFactoryItemTypeID: 1, // 要素项类型ID
+        DGFactoryItemID: dgfactoryitemid, // 预约要素项类型值
+        ItemTypeMode: 1, // 要素项类型模式
+    }]
+}
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const onSubmit = () => {
+    formRef.value?.validate((valid) => {
+        if (valid) {
+            formData.BuyOrSell = BuyOrSell.Buy
+            listingSubmit().then(() => {
+                ElMessage.success('提交成功')
+                onCancel(true)
+            }).catch((err) => {
+                ElMessage.error('提交失败:' + err)
+            })
+        }
+    })
+}
+</script>

+ 3 - 0
src/packages/pc/views/market/trade/spot/order/index.vue

@@ -12,6 +12,9 @@
                             <span>{{ quoteItem.deliverygoodsname }}</span>
                         </li>
                         <li>
+                            <span>{{ quoteItem.wrgoodsname }}</span>
+                        </li>
+                        <li>
                             <span>{{ quoteItem.warehousename }}</span>
                         </li>
                     </ul>

+ 1 - 1
src/packages/pc/views/query/capital/history/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading">
+            <app-filter :options="filterOptons">
                 <template #before>
                     <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
                         v-model="filterDate" />

+ 1 - 1
src/packages/pc/views/query/order/goods/history/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading">
+            <app-filter :options="filterOptons">
                 <template #before>
                     <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
                         v-model="filterDate" />

+ 1 - 1
src/packages/pc/views/query/order/spot/history/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading">
+            <app-filter :options="filterOptons">
                 <template #before>
                     <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
                         v-model="filterDate" />

+ 1 - 1
src/packages/pc/views/query/trade/goods/history/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading">
+            <app-filter :options="filterOptons">
                 <template #before>
                     <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
                         v-model="filterDate" />

+ 1 - 1
src/packages/pc/views/query/trade/spot/history/index.vue

@@ -2,7 +2,7 @@
 <template>
     <app-table :data="dataList" v-model:columns="tableColumns" :loading="loading">
         <template #header>
-            <app-filter :options="filterOptons" :loading="loading">
+            <app-filter :options="filterOptons">
                 <template #before>
                     <el-date-picker type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" value-format="YYYYMMDD"
                         v-model="filterDate" />

+ 7 - 5
src/services/api/account/index.ts

@@ -19,11 +19,10 @@ export function login(config: RequestConfig<Model.LoginReq> = {}) {
 /**
  * 用户登出
  */
-export function logout(config: RequestConfig<Proto.LogoutReq>) {
-    return http.mqRequest<Proto.LogoutRsp>({
-        data: config.data,
-        requestCode: 'LogoutReq',
-        responseCode: 'LogoutRsp',
+export function logout(config: RequestConfig = {}) {
+    return http.goRequest<Model.LoginRsp>({
+        url: '/Account/Loginout',
+        params: config.data,
     })
 }
 
@@ -33,6 +32,7 @@ export function logout(config: RequestConfig<Proto.LogoutReq>) {
 export function tokenCheck(config: RequestConfig = {}) {
     return http.goRequest({
         url: '/Account/TokenCheck',
+        params: config.data,
     })
 }
 
@@ -42,6 +42,7 @@ export function tokenCheck(config: RequestConfig = {}) {
 export function queryAccountMenu(config: RequestConfig = {}) {
     return http.commonRequest<Model.UserRoutes[]>({
         url: '/account/menu',
+        params: config.data,
     })
 }
 
@@ -94,6 +95,7 @@ export function queryTaAccounts(config: RequestConfig<Model.TaAccountsReq> = {})
 export function queryAccountRole(config: RequestConfig = {}) {
     return http.commonRequest<Model.UserRole[]>({
         url: '/account/role',
+        params: config.data,
     })
 }
 

+ 2 - 0
src/services/api/bank/index.ts

@@ -66,6 +66,7 @@ export function t2bBankDeposit(config: RequestConfig<Partial<Proto.t2bBankDeposi
 export function queryCusBankSignBank(config: RequestConfig = {}) {
     return http.commonRequest<Model.CusBankSignBankRsp[]>({
         url: '/Qhj/QueryCusBankSignBank',
+        params: config.data,
     })
 }
 
@@ -75,6 +76,7 @@ export function queryCusBankSignBank(config: RequestConfig = {}) {
 export function queryBankInfo(config: RequestConfig = {}) {
     return http.commonRequest<Model.BankInfoRsp[]>({
         url: '/Qhj/QueryBankInfo',
+        params: config.data,
     })
 }
 

+ 2 - 1
src/services/api/common/index.ts

@@ -20,6 +20,7 @@ const loginStore = useLoginStore()
 export function GetAppUpdateInfo(config: RequestConfig = {}) {
     return http.request<string>({
         url: service.getConfig('androidUpdateUrl'),
+        params: config.data,
     })
 }
 
@@ -242,7 +243,7 @@ export function postNoticeReaded(config: RequestConfig<Model.NoticeReadedReq> =
 /**
  * 获取金10资讯数据
  */
- export function getJ10News(config: RequestConfig<Model.J10NewsReq> = {}) {
+export function getJ10News(config: RequestConfig<Model.J10NewsReq> = {}) {
     return http.commonRequest<Model.J10NewsRsp[]>({
         url: '/Common/GetJ10News',
         params: config.data,

+ 1 - 1
src/services/api/credit/index.ts

@@ -31,6 +31,6 @@ export function queryTHJScoreConfig(config: RequestConfig<Model.THJScoreConfigRe
 /**
  * 铁合金抽奖
  */
-export function thjRedPacketLottery(params: Proto.THJRedPacketLotteryReq) {
+export function thjRedPacketLottery() {
     return Promise.reject('thjRedPacketLottery')
 }

+ 1 - 0
src/services/api/market/index.ts

@@ -27,6 +27,7 @@ export function querySpotgoodsPrice(config: RequestConfig<Model.SpotgoodsPriceRe
 export function queryThjSpotQuote(config: RequestConfig = {}) {
     return http.commonRequest<Model.ThjSpotQuoteRsp[]>({
         url: '/Ferroalloy/QueryThjSpotQuote',
+        params: config.data,
     })
 }
 

+ 11 - 2
src/services/websocket/trade.ts

@@ -1,6 +1,6 @@
 import { timerInterceptor } from '@/utils/timer'
 import { FunCode } from '@/constants/funcode'
-import { useLoginStore } from '@/stores'
+import { useLoginStore, useErrorInfoStore } from '@/stores'
 import service from '@/services'
 import eventBus from '@/services/bus'
 import { MTP2WebSocket } from './build'
@@ -14,10 +14,19 @@ export default new (class {
 
     constructor() {
         this.socket.onPush = (p) => {
-            const { funCode } = p
+            const { funCode, content } = p
             const delay = 1000 // 延迟推送消息,防止短时间内重复请求
 
             switch (funCode) {
+                case FunCode.LogoutRsp: {
+                    const { getErrorInfoByCode } = useErrorInfoStore()
+                    const decryptedData = new TextDecoder().decode(content)
+                    const res: Proto.LogoutRsp = JSON.parse(decryptedData)
+
+                    // 用户登出通知
+                    eventBus.$emit('LogoutNotify', getErrorInfoByCode(res.RetCode))
+                    break;
+                }
                 case FunCode.MoneyChangedNotify: {
                     timerInterceptor.debounce(() => {
                         // 资金变动通知

+ 2 - 1
src/stores/modules/futures.ts

@@ -21,7 +21,7 @@ export const useFuturesStore = defineStore(() => {
     // 行情列表
     const quoteList = computed(() => {
         return state.goodsList.reduce((res, cur) => {
-            const { agreeunit, goodsid, goodscode, goodsname, goodunitid, goodsgroupid, marketid, decimalplace, quoteminunit, trademode } = cur
+            const { agreeunit, goodsid, goodscode, goodsname, goodunitid, goodsgroupid, marketid, decimalplace, quoteminunit, trademode, quotegear } = cur
             const quoteDayInfo = state.quoteDayList.find((e) => e.goodscode.toUpperCase() === goodscode.toUpperCase())
             const {
                 averageprice = 0,
@@ -141,6 +141,7 @@ export const useFuturesStore = defineStore(() => {
                 highestColor: handleColor(highest),
                 lowestColor: handleColor(lowest),
                 trademode,
+                quotegear,
             }
             res.push(item)
             return res

+ 1 - 0
src/types/model/market.d.ts

@@ -129,5 +129,6 @@ declare namespace Model {
         limitup: number; // 涨停价
         quoteminunit: number;//行情最小变动单位 [整数,报价小数位一起使用]
         trademode: number;
+        quotegear: number;//行情档位
     }
 }