zhongrj
2024-04-28 d50bb56965dc110d448cc5107d69cd443944d11b
开放sso测试
4 files modified
34 ■■■■ changed files
src/api/user.js 8 ●●●● patch | view | raw | blame | history
src/config/website.js 12 ●●●● patch | view | raw | blame | history
src/page/login/index.vue 10 ●●●● patch | view | raw | blame | history
vue.config.js 4 ●●●● patch | view | raw | blame | history
src/api/user.js
@@ -2,7 +2,7 @@
import website from "@/config/website";
export const loginByUsername = (tenantId, deptId, roleId, username, password, type, key, code) => request({
  url: '/api/blade-auth/oauth/token',
  url: '/api/oauth/token',
  method: 'post',
  headers: {
    'Tenant-Id': tenantId,
@@ -24,7 +24,7 @@
});
export const loginBySocial = (tenantId, source, code, state) => request({
  url: '/api/blade-auth/oauth/token',
  url: '/api/oauth/token',
  method: 'post',
  headers: {
    'Tenant-Id': tenantId
@@ -40,7 +40,7 @@
})
export const loginBySso = (state, code) => request({
  url: '/api/blade-auth/oauth/token',
  url: '/api/oauth/token',
  method: 'post',
  headers: {
    'Tenant-Id': state
@@ -55,7 +55,7 @@
})
export const refreshToken = (refresh_token, tenantId, deptId, roleId) => request({
  url: '/api/blade-auth/oauth/token',
  url: '/api/oauth/token',
  method: 'post',
  headers: {
    'Tenant-Id': tenantId,
src/config/website.js
@@ -2,12 +2,12 @@
 * 全局配置文件
 */
export default {
  title: "jczz",
  title: "sword",
  logo: "J",
  key: "jczz", //配置主键,目前用于存储
  key: "sword", //配置主键,目前用于存储
  indexTitle: "基层智治综合协同平台",
  clientId: "jczz", // 客户端id
  clientSecret: "jczz_secret_FaXfddsafRsfjlsdf2A12412", // 客户端密钥
  clientId: "sword", // 客户端id
  clientSecret: "sword_secret", // 客户端密钥
  tenantMode: true, // 是否开启租户模式
  tenantId: "000000", // 管理组租户编号
  captchaMode: true, // 是否开启验证码模式
@@ -49,10 +49,10 @@
  // reportUrl: 'http://localhost:9528/ureport',
  // 单点登录系统认证(blade-auth服务的地)
  ssoUrl:
    "http://localhost:8100/oauth/authorize?client_id=saber&response_type=code&redirect_uri=",
    "http://localhost:8100/oauth/authorize?client_id=sword&response_type=code&redirect_uri=",
  // 单点登录回调地址(Saber服务的地址)
  redirectUri: "http://localhost:1888",
  // redirectUri:'http://192.168.0.102:9528',
  // redirectUri:'http://192.168.1.50:8100',
  // minio 基础路径
  minioUrl: "https://srgdjczzxtpt.com:2080/gminio/jczz/",
};
src/page/login/index.vue
@@ -20,12 +20,12 @@
                    </h4>
                    <userLogin v-if="activeName === 'user'"></userLogin>
                    <!-- <codeLogin v-else-if="activeName==='code'"></codeLogin> -->
                    <!-- <thirdLogin v-else-if="activeName==='third'"></thirdLogin> -->
                    <thirdLogin v-else-if="activeName==='third'"></thirdLogin>
                    <div class="login-menu">
                        <!-- <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a> -->
                        <!--<a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>-->
                        <!-- <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a> -->
                        <!-- <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a> -->
                        <a href="#" @click.stop="activeName='user'">{{ $t('login.userLogin') }}</a>
                        <a href="#" @click.stop="activeName='code'">{{ $t('login.phoneLogin') }}</a>
                        <a href="#" @click.stop="activeName='third'">{{ $t('login.thirdLogin') }}</a>
                        <a :href="website.ssoUrl + website.redirectUri">{{ $t('login.ssoLogin') }}</a>
                    </div>
                </div>
vue.config.js
@@ -38,8 +38,8 @@
        proxy: {
            "/api": {
                //本地服务接口地址
                // target:"http://192.168.1.50:9528",
                target: "https://srgdjczzxtpt.com:2080/api",
                target:"http://192.168.1.50:8110/",
                // target: "https://srgdjczzxtpt.com:2080/api",
                // target: "https://kt39592615.goho.co",
                // target: "http://z4042833u6.wicp.vip",
                // target: "http://localhost:9528",