|
@@ -48,11 +48,11 @@
|
|
<div class="form-container">
|
|
<div class="form-container">
|
|
<h1>{{ '授权-沙盒' }}</h1>
|
|
<h1>{{ '授权-沙盒' }}</h1>
|
|
<el-form :model="AuthorizationForm" :rules="loginRules" ref="AuthorizationFormRef" label-width="120px">
|
|
<el-form :model="AuthorizationForm" :rules="loginRules" ref="AuthorizationFormRef" label-width="120px">
|
|
- <el-form-item label="店铺名称:" prop="store_name">
|
|
|
|
- <el-input v-model="AuthorizationForm.store_name" placeholder="卖家自定义,以做区分" clearable></el-input>
|
|
|
|
|
|
+ <el-form-item label="店铺名称:" prop="storeName">
|
|
|
|
+ <el-input v-model="AuthorizationForm.storeName" placeholder="卖家自定义,以做区分" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="平台账号:" prop="platform_account">
|
|
|
|
- <el-input v-model="AuthorizationForm.platform_account" placeholder="卖家平台上的账号" clearable></el-input>
|
|
|
|
|
|
+ <el-form-item label="平台账号:" prop="platformAccount">
|
|
|
|
+ <el-input v-model="AuthorizationForm.platformAccount" placeholder="卖家平台上的账号" clearable></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="区域:" prop="region">
|
|
<el-form-item label="区域:" prop="region">
|
|
<el-select v-model="AuthorizationForm.region" placeholder="请选择区域" @change="handleRegionChange">
|
|
<el-select v-model="AuthorizationForm.region" placeholder="请选择区域" @change="handleRegionChange">
|
|
@@ -66,14 +66,14 @@
|
|
<el-checkbox v-for="city in cityOptions" :label="city" :key="city">{{ city }}</el-checkbox>
|
|
<el-checkbox v-for="city in cityOptions" :label="city" :key="city">{{ city }}</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="店铺类型:" prop="store_type">
|
|
|
|
- <el-radio-group v-model="AuthorizationForm.store_type">
|
|
|
|
|
|
+ <el-form-item label="店铺类型:" prop="storeType">
|
|
|
|
+ <el-radio-group v-model="AuthorizationForm.storeType">
|
|
<el-radio label="1">跨境</el-radio>
|
|
<el-radio label="1">跨境</el-radio>
|
|
<el-radio label="2">本土</el-radio>
|
|
<el-radio label="2">本土</el-radio>
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="店铺模式:" prop="store_model">
|
|
|
|
- <el-checkbox-group v-model="AuthorizationForm.store_model">
|
|
|
|
|
|
+ <el-form-item label="店铺模式:" prop="storeModel">
|
|
|
|
+ <el-checkbox-group v-model="AuthorizationForm.storeModel">
|
|
<el-checkbox label="1">FBM</el-checkbox>
|
|
<el-checkbox label="1">FBM</el-checkbox>
|
|
<el-checkbox label="2">FBA</el-checkbox>
|
|
<el-checkbox label="2">FBA</el-checkbox>
|
|
</el-checkbox-group>
|
|
</el-checkbox-group>
|
|
@@ -93,12 +93,12 @@
|
|
const app = createApp({
|
|
const app = createApp({
|
|
setup() {
|
|
setup() {
|
|
const AuthorizationForm = ref({
|
|
const AuthorizationForm = ref({
|
|
- store_name: '',
|
|
|
|
- platform_account: '',
|
|
|
|
|
|
+ storeName: '',
|
|
|
|
+ platformAccount: '',
|
|
region: 'https://sellingpartnerapi-na.amazon.com',
|
|
region: 'https://sellingpartnerapi-na.amazon.com',
|
|
site: ['美国', '加拿大', '墨西哥', '巴西'],
|
|
site: ['美国', '加拿大', '墨西哥', '巴西'],
|
|
- store_type: '1',
|
|
|
|
- store_model: ['1'],
|
|
|
|
|
|
+ storeType: '1',
|
|
|
|
+ storeModel: ['1'],
|
|
checkAll: false,
|
|
checkAll: false,
|
|
});
|
|
});
|
|
|
|
|
|
@@ -110,12 +110,12 @@
|
|
|
|
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const loginRules = ref({
|
|
const loginRules = ref({
|
|
- store_name: [{ required: true, message: '请输入店铺名称', trigger: 'blur' }],
|
|
|
|
- platform_account: [{ required: true, message: '请输入平台账号', trigger: 'blur' }],
|
|
|
|
|
|
+ storeName: [{ required: true, message: '请输入店铺名称', trigger: 'blur' }],
|
|
|
|
+ platformAccount: [{ required: true, message: '请输入平台账号', trigger: 'blur' }],
|
|
region: [{ required: true, message: '请选择区域', trigger: 'change' }],
|
|
region: [{ required: true, message: '请选择区域', trigger: 'change' }],
|
|
site: [{ type: 'array', required: true, message: '请至少选择一个站点', trigger: 'change' }],
|
|
site: [{ type: 'array', required: true, message: '请至少选择一个站点', trigger: 'change' }],
|
|
- store_type: [{ required: true, message: '请选择店铺类型', trigger: 'change' }],
|
|
|
|
- store_model: [{ type: 'array', required: true, message: '请至少选择一个店铺模式', trigger: 'change' }],
|
|
|
|
|
|
+ storeType: [{ required: true, message: '请选择店铺类型', trigger: 'change' }],
|
|
|
|
+ storeModel: [{ type: 'array', required: true, message: '请至少选择一个店铺模式', trigger: 'change' }],
|
|
});
|
|
});
|
|
const cityOptions = ref([]);
|
|
const cityOptions = ref([]);
|
|
const AuthorizationFormRef = ref(null);
|
|
const AuthorizationFormRef = ref(null);
|
|
@@ -159,7 +159,7 @@
|
|
...AuthorizationForm.value,
|
|
...AuthorizationForm.value,
|
|
uuid: uuid,
|
|
uuid: uuid,
|
|
site: AuthorizationForm.value.site.join(','),
|
|
site: AuthorizationForm.value.site.join(','),
|
|
- store_model: AuthorizationForm.value.store_model.join(','),
|
|
|
|
|
|
+ storeModel: AuthorizationForm.value.storeModel.join(','),
|
|
};
|
|
};
|
|
|
|
|
|
const response = await axios.post('https://apisaas.raycos.net/erp/store/add', formData, {
|
|
const response = await axios.post('https://apisaas.raycos.net/erp/store/add', formData, {
|
|
@@ -168,12 +168,12 @@
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|
|
- if (response.data.success) {
|
|
|
|
|
|
+ if (response.code==200) {
|
|
const authUrl = generateAuthUrl(formData.region, uuid);
|
|
const authUrl = generateAuthUrl(formData.region, uuid);
|
|
window.open(authUrl, '_blank');
|
|
window.open(authUrl, '_blank');
|
|
ElMessage.success('提交成功');
|
|
ElMessage.success('提交成功');
|
|
} else {
|
|
} else {
|
|
- ElMessage.error(response.data.message || '提交失败');
|
|
|
|
|
|
+ ElMessage.error(response.msg || '提交失败');
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
console.error('Authorization error:', error);
|
|
console.error('Authorization error:', error);
|