Commit a99ca89c by 张立顺

fix 修改权益配置

1 parent 83b7401a
...@@ -31,8 +31,8 @@ const request = ( ...@@ -31,8 +31,8 @@ const request = (
apiName = parts[2] apiName = parts[2]
} }
} }
console.log("params.method", params.method) // console.log("params.method", params.method)
console.log("apiName", apiName) // console.log("apiName", apiName)
// 为空报错 // 为空报错
if (!apiName) { if (!apiName) {
throw new Error("apiName is null") throw new Error("apiName is null")
...@@ -50,7 +50,7 @@ const request = ( ...@@ -50,7 +50,7 @@ const request = (
} }
const baseApiName = mappingName[apiName] const baseApiName = mappingName[apiName]
console.log(baseApiName, baseConfig, "baseApiName") // console.log(baseApiName, baseConfig, "baseApiName")
// params.appKey = baseConfig[baseApiName].appkey // params.appKey = baseConfig[baseApiName].appkey
if (baseApiName == "common") { if (baseApiName == "common") {
params.app_key = baseConfig[baseApiName].appkey params.app_key = baseConfig[baseApiName].appkey
......
...@@ -257,6 +257,9 @@ export default { ...@@ -257,6 +257,9 @@ export default {
// 后台接口 -> store // 后台接口 -> store
// await dispatch('d2admin/auth/init', null, { root: true }) // await dispatch('d2admin/auth/init', null, { root: true })
// end // end
dispatch("d2admin/user/getScrmInfoLoad", null, {
root: true
})
resolve() resolve()
}) })
} }
......
...@@ -57,13 +57,7 @@ export default { ...@@ -57,13 +57,7 @@ export default {
}, },
mutations: { mutations: {
setDownloadList(state, { list, type }) { setDownloadList(state, { list, type }) {
// console.log(list)
// return
// state[type] = state[type].push(list)
state[type] = list state[type] = list
// console.log(state[`${type}`])
// console.log(state[type])
}, },
setUpdateRefesh(state, data) { setUpdateRefesh(state, data) {
state.updateRefesh = data state.updateRefesh = data
...@@ -83,10 +77,6 @@ export default { ...@@ -83,10 +77,6 @@ export default {
actionSetDownloadList({ commit, dispatch, state }, { list, type }) { actionSetDownloadList({ commit, dispatch, state }, { list, type }) {
// console.log(list, type) // console.log(list, type)
commit("setDownloadList", { list, type }) commit("setDownloadList", { list, type })
// console.log()
// console.log(dispatch)
// console.log(state[type])
// console.log(`state.${type}`)
// 持久化 // 持久化
dispatch( dispatch(
"d2admin/db/set", "d2admin/db/set",
...@@ -101,6 +91,26 @@ export default { ...@@ -101,6 +91,26 @@ export default {
) )
}, },
/** /**
* @description 修改下载记录
* @param {Object} state state
*/
actionSetScrmInfo({ commit, dispatch, state }, data) {
console.log(data, "actionSetScrmInfo")
commit("setScrmInfo", data)
// 持久化
dispatch(
"d2admin/db/set",
{
dbName: "sys",
path: `user.scrmInfo`,
value: state.scrmInfo,
// state.dowloadList,
user: true
},
{ root: true }
)
},
/**
* @description 设置用户数据 * @description 设置用户数据
* @param {Object} context * @param {Object} context
* @param {*} info info * @param {*} info info
...@@ -145,7 +155,22 @@ export default { ...@@ -145,7 +155,22 @@ export default {
}, },
{ root: true } { root: true }
) )
// console.log(type, state[type]) resolve()
})
},
getScrmInfoLoad({ state, dispatch }) {
return new Promise(async (resolve) => {
// store 赋值
state.scrmInfo = await dispatch(
"d2admin/db/get",
{
dbName: "sys",
path: `user.scrmInfo`,
defaultValue: [],
user: true
},
{ root: true }
)
resolve() resolve()
}) })
}, },
...@@ -165,6 +190,7 @@ export default { ...@@ -165,6 +190,7 @@ export default {
sessionStorage.removeItem(ACCOUNT_SESSION_NAME) sessionStorage.removeItem(ACCOUNT_SESSION_NAME)
dispatch("actionSetDownloadList", { list: [], type: "updateList" }) dispatch("actionSetDownloadList", { list: [], type: "updateList" })
dispatch("actionSetDownloadList", { list: [], type: "dowloadList" }) dispatch("actionSetDownloadList", { list: [], type: "dowloadList" })
dispatch("actionSetScrmInfo", {})
resolve() resolve()
}) })
}, },
......
...@@ -15,9 +15,9 @@ import { mapState } from "vuex" ...@@ -15,9 +15,9 @@ import { mapState } from "vuex"
export default { export default {
data() { data() {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" // iframeSrc: "http://192.168.1.178:6654",
iframeUrl: "/#/ContractManager/index"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,38 +17,48 @@ export default { ...@@ -17,38 +17,48 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/addCode/index"
} }
}, },
computed: { computed: {
// sessionId, merchantId // sessionId, merchantId
iframeUrlWithParams() {
// 处理单个参数的函数
const updateParam = (url, paramName, paramValue) => {
const regex = new RegExp(`([?&])${paramName}=[^&]*`)
if (url.includes(`${paramName}=`)) {
return url.replace(regex, `$1${paramName}=${paramValue}`)
} else {
return (
url + (url.includes("?") ? "&" : "?" + `${paramName}=${paramValue}`)
)
}
}
// iframeUrlWithParams() { let finalUrl = this.iframeUrl
// // 检查是否已经有 t 参数
// if (this.iframeUrl.includes('?t=')) { // 处理 sessionId
// // 如果已经有 t 参数,替换它 finalUrl = updateParam(finalUrl, "sessionId", this.scrmInfo.sessionId)
// return this.iframeUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.scrmInfo.sessionId);
// } else { // 处理 merchantId
// // 如果没有 t 参数,添加它 finalUrl = updateParam(finalUrl, "merchantId", this.scrmInfo.merchantId)
// return this.iframeUrl.includes('?')
// ? this.iframeUrl + '&sessionId=' + this.scrmInfo.sessionId return finalUrl
// : this.iframeUrl + '?sessionId=' + this.scrmInfo.sessionId; },
// }
// },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/appointment/index"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/beforeSale/checkSet"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -15,9 +15,9 @@ import { mapState } from "vuex" ...@@ -15,9 +15,9 @@ import { mapState } from "vuex"
export default { export default {
data() { data() {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" // iframeSrc: "http://192.168.1.178:6654",
iframeUrl: "/#/claims/index"
} }
}, },
computed: { computed: {
...@@ -45,32 +45,20 @@ export default { ...@@ -45,32 +45,20 @@ export default {
return finalUrl return finalUrl
}, },
// iframeUrlWithParams() {
// // 检查是否已经有 t 参数
// if (this.iframeUrl.includes('?t=')) {
// // 如果已经有 t 参数,替换它
// return this.iframeUrl.replace(/(\?|&)t=[^&]+/, '$1t=' + this.scrmInfo.sessionId);
// } else {
// // 如果没有 t 参数,添加它
// return this.iframeUrl.includes('?')
// ? this.iframeUrl + '&sessionId=' + this.scrmInfo.sessionId
// : this.iframeUrl + '?sessionId=' + this.scrmInfo.sessionId;
// }
// },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/config/index"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/beforeSale/equitySummary"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -85,19 +85,19 @@ export default { ...@@ -85,19 +85,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -17,7 +17,7 @@ export default { ...@@ -17,7 +17,7 @@ export default {
return { return {
// iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account', // iframeSrc: 'https://oss-account-padtest.glsx.com.cn/customer/account',
iframeSrc: baseConfig.scrm, iframeSrc: baseConfig.scrm,
iframeUrl: "/index.html" iframeUrl: "/#/serviceConfig/index"
} }
}, },
computed: { computed: {
...@@ -58,19 +58,19 @@ export default { ...@@ -58,19 +58,19 @@ export default {
// } // }
// }, // },
...mapState({ ...mapState({
SSOInfo: (state) => state.d2admin.user.scrmInfo scrmInfo: (state) => state.d2admin.user.scrmInfo
}) })
}, },
mounted() { mounted() {
// 监听来自 iframe 的消息 // 监听来自 iframe 的消息
window.addEventListener("message", (event) => { // window.addEventListener("message", (event) => {
console.log("收到 iframe 消息:", event.data) // console.log("收到 iframe 消息:", event.data)
if (event.data.type === "location-change") { // if (event.data.type === "location-change") {
console.log("Iframe 地址已改变:", event.data.url) // console.log("Iframe 地址已改变:", event.data.url)
// 在这里可以执行其他操作,比如更新 iframe 的 src 属性 // // 在这里可以执行其他操作,比如更新 iframe 的 src 属性
this.handleIframeLocationChange(event.data.url) // this.handleIframeLocationChange(event.data.url)
} // }
}) // })
}, },
methods: { methods: {
handleIframeLocationChange(url) { handleIframeLocationChange(url) {
......
...@@ -217,6 +217,11 @@ export default { ...@@ -217,6 +217,11 @@ export default {
hasReg: false hasReg: false
} }
}, },
computed: {
...mapState({
scrmInfo: (state) => state.d2admin.user.scrmInfo
})
},
created() { created() {
this.systemName = this.baseConfig.sysName || "系统" this.systemName = this.baseConfig.sysName || "系统"
this.systemSubName = this.baseConfig.subName || "说明" this.systemSubName = this.baseConfig.subName || "说明"
...@@ -232,13 +237,15 @@ export default { ...@@ -232,13 +237,15 @@ export default {
clearInterval(this.timeInterval) clearInterval(this.timeInterval)
}, },
methods: { methods: {
// ...mapActions('d2admin/user', ['load', 'loadAcocunt', 'actionSetDownloadList']),
...mapActions({ ...mapActions({
login: "d2admin/account/login", login: "d2admin/account/login",
getAuth: "d2admin/account/getAuth", getAuth: "d2admin/account/getAuth",
current: "d2admin/page/currentGet", current: "d2admin/page/currentGet",
initBaseData: "d2admin/base/init" initBaseData: "d2admin/base/init",
actionSetScrmInfo: "d2admin/user/actionSetScrmInfo"
}), }),
...mapActions("d2admin/user", ["setScrmInfo"]), // ...mapActions("d2admin/user", ["setScrmInfo"]),
scrmLogin() { scrmLogin() {
// scrm 登录 // scrm 登录
scrmLogin({ scrmLogin({
...@@ -252,7 +259,7 @@ export default { ...@@ -252,7 +259,7 @@ export default {
}) })
.then((res) => { .then((res) => {
const { sessionId, merchantId } = res.loginList[0] const { sessionId, merchantId } = res.loginList[0]
this.setScrmInfo({ sessionId, merchantId }) this.actionSetScrmInfo({ sessionId, merchantId })
console.log(res) console.log(res)
}) })
.catch((err) => { .catch((err) => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!