fix: include system origin in rocket config requests
This commit is contained in:
parent
d028ed7b90
commit
2856f3488a
@ -200,6 +200,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRocketConfigs, updateRocketConfig } from '@/api/rocket-config'
|
import { listRocketConfigs, updateRocketConfig } from '@/api/rocket-config'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
const createEmptyReward = () => ({
|
const createEmptyReward = () => ({
|
||||||
type: 'GOLD',
|
type: 'GOLD',
|
||||||
@ -254,6 +255,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
...mapGetters(['permissionsFirstSysOrigin']),
|
||||||
rewardTypes() {
|
rewardTypes() {
|
||||||
return [
|
return [
|
||||||
{ value: 'GOLD', label: this.$t('pages.rocketConfig.types.gold') },
|
{ value: 'GOLD', label: this.$t('pages.rocketConfig.types.gold') },
|
||||||
@ -264,12 +266,16 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if (!this.permissionsFirstSysOrigin) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.loadConfigs()
|
this.loadConfigs()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadConfigs() {
|
loadConfigs() {
|
||||||
this.listLoading = true
|
this.listLoading = true
|
||||||
listRocketConfigs().then(response => {
|
// AppExtCommand 要求携带当前账号有权限的系统来源,否则后端无法构造 reqSysOrigin。
|
||||||
|
listRocketConfigs({ sysOrigin: this.permissionsFirstSysOrigin.value }).then(response => {
|
||||||
this.configList = response.body || []
|
this.configList = response.body || []
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.listLoading = false
|
this.listLoading = false
|
||||||
@ -334,6 +340,8 @@ export default {
|
|||||||
// 仅提交服务端当前真正生效的配置,未使用字段继续保留数据库原值。
|
// 仅提交服务端当前真正生效的配置,未使用字段继续保留数据库原值。
|
||||||
const payload = {
|
const payload = {
|
||||||
id: this.form.id,
|
id: this.form.id,
|
||||||
|
// 更新接口同样继承 AppExtCommand,保存时必须携带系统来源。
|
||||||
|
sysOrigin: this.permissionsFirstSysOrigin.value,
|
||||||
maxEnergy: this.form.maxEnergy,
|
maxEnergy: this.form.maxEnergy,
|
||||||
status: this.form.status,
|
status: this.form.status,
|
||||||
rewardConfig: this.form.rewardConfig.map(item => {
|
rewardConfig: this.form.rewardConfig.map(item => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user