Skip to content

Commit

Permalink
Merge pull request #308 from LiusCraft/fix/user-unlink
Browse files Browse the repository at this point in the history
fix: hide disabled entry
  • Loading branch information
CarlJi committed Mar 18, 2024
2 parents 08ad380 + 59f4e18 commit c421c81
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions cmd/gopcomm/yap/user_edit_yap.html
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ <h3 class="text-2xl font-bold text-gray-900 mb-1">Bind accounts</h3>
const canSubmit = ref(true)
function customRequest(option) {
canSubmit.value = false
console.log("option", option)
const file = option.file
const avatarData = new FormData();
avatarData.append('file', file.file);
Expand Down Expand Up @@ -683,7 +682,6 @@ <h3 class="text-2xl font-bold text-gray-900 mb-1">Bind accounts</h3>
if (provider === null || !provider.type) {
return "";
}
console.log("provider:", provider)
let endpoint = authInfo[provider.type].endpoint;
let redirectUri = `${casdoorUrl}/callback`;
const scope = authInfo[provider.type].scope;
Expand Down Expand Up @@ -928,60 +926,75 @@ <h3 class="text-2xl font-bold text-gray-900 mb-1">Bind accounts</h3>
if(prov) {
return prov.provider
}
return {};
return undefined;
}

/*======= register vue component =======*/
const app = Vue.createApp({
data() {
return {
wechatModel,
buttonTheme,
inputTheme,
selectTheme,
datePickerTheme,
tabsTheme,
formRef,
rules,
canSubmit,
userProfile,
genderOptions,
fileList,
user,
accountList: [
const accountList = []
let temp = [
{
img: "/static/img/social_github.png",
platform: "GitHub",
desc: "https://github.com",
bind: accountBinds.Github,
provider: authInfo.GitHub,
url: getAuthUrl(findProvider("GitHub"), "link")
url: ""
},
{
img: "/static/img/social_twitter.png",
platform: "Twitter",
desc: "https://twitter.com",
bind: accountBinds.Twitter,
provider: authInfo.Twitter,
url: getAuthUrl(findProvider("Twitter"), "link")
url: ""
},
{
img: "/static/img/social_facebook.png",
platform: "Facebook",
desc: "https://facebook.com",
bind: accountBinds.Facebook,
provider: authInfo.Facebook,
url: getAuthUrl(findProvider("Facebook"), "link")
url: ""
},
{
img: "/static/img/social_wechat.png",
platform: "WeChat",
desc: "https://weixin.qq.com",
bind: accountBinds.WeChat,
provider: authInfo.WeChat,
url: "WeChat"
url: ""
}
]
temp.forEach((e,i) => {
let provider = findProvider(e.platform)
if(!provider) {
return
}
if(e.platform === "WeChat") {
e.url = "WeChat"
}else {
e.url = getAuthUrl(provider, "link")
}

accountList.push(e)
})
return {
wechatModel,
buttonTheme,
inputTheme,
selectTheme,
datePickerTheme,
tabsTheme,
formRef,
rules,
canSubmit,
userProfile,
genderOptions,
fileList,
user,
accountList
}
},
methods: {
Expand Down

0 comments on commit c421c81

Please sign in to comment.